Welcome to WebmasterWorld Guest from 54.82.10.219

Forum Moderators: open

Message Too Old, No Replies

jquery and image map onclick help

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Sept 8, 2006
posts:1232
votes: 0


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.
6:27 pm on Aug 20, 2016 (gmt 0)

Senior Member from GB 

WebmasterWorld Senior Member andy_langton is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Jan 27, 2003
posts:3332
votes: 140


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

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members