Changing the state of the clicked dot


show more Changing the state of the clicked dot provides you with in-depth training on Web. Taught by Chris Converse as part of the Create an Interactive Map with jQuery and Dreamweaver show less
please wait ...

Changing the state of the clicked dot

Now we have the JavaScript in place that's paying attention to the form element and making sure that when it changes we show and hide the different dots. Now we want to add a script that's going to pay attention to the dots and check to see if the user clicked on them. So let's come back to the interactive_map.js file. Now inside of here I am going to clean up the formatting here a little bit, get rid of some of the whitespace, get rid of some of these extra lines. I am doing this because I need to make sure that I add the click events for the anchor tags inside of the document ready but outside of the mapForm.

So let's hit a few returns. So again I am outside of the mapForm but inside of the ('document').ready. Let's start by typing $('a.dot') as a string literal, so for every time there is an anchor tag with a dot class, outside of the parentheses we are going to type .click();. Inside of the click we are going to type function(), beginning and ending ...

Changing the state of the clicked dot
Video duration: 4m 29s 1h 12m Intermediate Updated Aug 31, 2011

Viewers:

Changing the state of the clicked dot provides you with in-depth training on Web. Taught by Chris Converse as part of the Create an Interactive Map with jQuery and Dreamweaver

Subject:
Web
Software:
Dreamweaver jQuery
Author:
please wait ...