- This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- The forum ‘JavaScript’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › JavaScript › Show a div if nav item is selected
Hello,
I want to show a little message underneath a nav item if its currently selected. I have been doing some research on how to do this and haven’t gotten very far. I know I have seen this done in css3 and in jquery. i know I posted this in the javascript forum but I would like to know how to do it both ways. Here is a screen shot of what i want to accomplish http://cl.ly/3f3W04401f1w1L2K212F I already have a ul for the nav, with a class of .current for the selected nav item. Now i just need to know what the best way to hide the information for the unselected nav item. I played around with some jquery, using a if statement .hasClass and .removeClass functions with no luck. I just need to be pointed in the right direction. Thanks for any help.
Here is a pure CSS version for you: http://jsfiddle.net/joshnh/a2HGf/
If you have any questions feel free to ask!
Thanks guys for the information. Joshuan thats exactly what I needed. Much appreciated
No worries at all! Feel free to use/abuse that code too.
How do you make this a vertical menu?