Text navigation to auto-appear on certain pages?

Morgan19

Registered
I was wondering if there's a fairly simple way to set up navigation to behave in this way. Let's say that I have a cell on the left side of my site that has simple text links as navigation, set up with the following main sections:

Home
About Us
Archives
News


What I'd like to happen is that when you're on any pages in the About Us section, for example, a secondary bit of textual links would be shown under the main About Us link, like this:

Home
About Us
...Sublink 1
...Sublink 2
...Sublink 3
Archives
News


But then when a user arrives on a News page, only News subpages would be shown (and the About Us sublinks would be "rolled" back up), like this:

Home
About Us
Archives
News
...Sublink 1
...Sublink 2


So basically, I'd like the sublevel navigation to only show when a user is on a particular section. My guess was that this would involve some JavaScript coding, but I'm not sure how to proceed.

m19
 
Give each page in a specific section a body id ( body id="nav_news", body id="nav_aboutus" ).

Wrap each submenu in a div or such with a unique id. Set those IDs to display: none via your css file. The write a rule that uses the body id to turn on the appropriate submenu id.

http://test.designs4efx.com/Morgan19 (also attached as zip)

No nasty JS coding...those with browsers which ignore CSS will just see all the submenus expanded.
 

Attachments

  • Archive.zip
    7.1 KB · Views: 1
Back
Top