Wednesday, September 14, 2011

How can I change the visability of a DIV when im on a certain page?

Hey guys,



I'm trying to create a tabbed navigation bar which has a sub menu bar underneith this with extra link options.



What I want is to change the bar depending what page the user is on.



The way I can think of is to build the sub-menus and set them to display:none; then in the CSS set the body id to something (lets say home) and then target the body#home #sub_menu .home sub menu and say display:block;



But when I do this it does nothing and still is set as display:none; I have tried visabliity also. Any ideas?



heres a link to the template if you are unsure of what i am asking.



http://www.simplegaming.net/dev/icecast/



thanks in advance!How can I change the visability of a DIV when im on a certain page?Use Javascript to change the document.GetElementById('your div').style.display = whatYouWant;How can I change the visability of a DIV when im on a certain page?here is a code example which should help you out. Just modify some of the parameters to meet your needs.



http://snipt.net/ellcom/php-arrays-for-menus -- changes pages using ?page=home or ?page=support and so on,