Join Chris Converse for an in-depth discussion in this video Showing and hiding dots based on continents, part of Create an Interactive Map with jQuery and Dreamweaver.
Now that we have a script that's paying attention to whether or not the form has…been changed, now we want to change the dots based on what the user has selected.…So let's hit a few Returns.…Let's type "var" for variable.…Let's type "selectedContinent," space, equals, space.…So this is a variable name that we are making up, and we are going to set the…value of that to this item here that we ran in the alert.…So let's come up here and copy that statement. Let's come down here after…selectedContinent = and let's just paste that in place and add a…semicolon at the end.…
So now with that in place, let's just get rid of the alert altogether.…So now we are declaring a new variable called selected continent, and the value…of that is going to be whatever the user has selected.…Let's add a few more lines.…Let's type if, beginning and ending parentheses, beginning and ending bracket.…Split that open.…Inside of the parentheses we can put a few spaces in here.…We are going to say if selectedContinent, two equal signs, two tick marks and then ALL.…
Take a look at the finished web site here.
- Preparing web graphics
- Preparing the base container
- Manipulating links with CSS
- Adding a drop-down menu
- Downloading jQuery and adding interactivity to a project
- Creating city details
- Overriding click events of anchor tags with jQuery
- Enhancing the design with CSS3