Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Active Navigation using JS

Status
Not open for further replies.

MicahDB

Programmer
Jul 15, 2004
96
US
All,

It has been a while since I've used JS, so I thought I would pose this question to some more knowledgeable people on the subject.

I need to create some nav elements and have the navigation of the current page be bold (for example). Seems like I can do this using JS and declare a curPage var or something.

Like I said, it has been a while.

Thanks in advance...

Micah
 
This is entirely do-able. However, given that there are virtually in infinite number of ways of coding menus, it would be easier to suggest something if we could see what you have right now, rather than giving you a solution that doesn't really integrate with your existing code...

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Evening, chap. Is the Monkey keeping you up late? We just got back from a Speyside whisky tatsing evening at the Scotch Malt Whisky Society and thought some TT would round the evening off nicely.

Off topic, but hey... ;-)

Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Gents,

Thanks for the replies. I knew that this would be the response as soon as I hit submit.

I'm looking simply (I hope) for something like that left nav on this site. There's a css mouseover event that changes the text color and I get that in looking at the code and supporting files. I don't however see how the "downevent" works for each page.

Again, any help is appreciated.


Thanks,
Micah
 
I don't think that the "remembered" (i.e. current page) state is done with JavaScript. In fact, I doubt there are many menus out there that do use purely a client-side solution.

My guess is that the Bank of America nav is delivered to the browser with the correct element already selected (with a class of 'selected'), much like so many navs out there.

If you don't akready have a nav in place, try something like the Suckerfish drop downs (search on Google), or look at for a suitable one.

Note: You probably want to combine whatever you choose with some server-side scripting to select the correct menu item when users navigate to certain sections. Without server-side coding, you'd be talking about frames or cookies, neither of which I'd recommend.

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top