Forum Moderators: open

Message Too Old, No Replies

jquery and image map onclick help

         

tonynoriega

3:11 pm on Aug 12, 2016 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Afternoon all... so I have an image map with several hot spots. I then have UL that utilizes an image sprite to highlight the LI when you click on a hot spot.

What I am having trouble figuring out is how to turn one LI 'off' or back to its original state when another is clicked.

I created an example: [jsfiddle.net...]

Am looking for a little guidance if possible on how to accomplish this.

Andy Langton

6:27 pm on Aug 20, 2016 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I would suggest using something like toggleclass [api.jquery.com] to alternate between the original and new state. E.g.
$( "li.togglable" ).toggleClass( "active" )