Click to See Complete Forum and Search --> : JS for a context sensative nav bar
geek_grrrl
02-18-2003, 10:31 PM
I'd like to create a context sensitive nav bar and was wondering if any one
can point me in the right direction.
What I want my nav bar to do is detect the page it's on (e.g., About Us) and
display the corresponding button (e.g. About Us) in a down state when the page loads. Ideally I'd like to be able to use either CSS buttons or graphics.
Does anyone know how I can do this (perhaps using java script?) so that what I actually have is the same code on every page of my site?
Many thanks
GG
Here is some code that I made for my site. You will see that each of the <div> tags has an id. The id _must_ be the same as the name of your page. (ie. if you page is home.htm, your div is <div id="home.htm"...>)
geek_grrrl
02-19-2003, 05:48 PM
Mate (I have to say that cos I'm an Aussie) you totally rock my tiny world. You have no idea how many times I've tried to get help with this over the last couple of years. I'll have a play this week.
Cheers
Originally posted by geek_grrrl
Mate (I have to say that cos I'm an Aussie):p
Originally posted by geek_grrrl
I'll have a play this week.Let me know how you get on...
geek_grrrl
02-20-2003, 11:02 PM
OK, have played around with the scripts loading the one from you here - http://www.jeti.com.au/original/beta/html/smart_meun_demo.htm - and then a page called "geek_grrrl2.htm" here http://jeti.com.au/original/beta/html/geek_grrrl2.htm.
Geek_grrrl2.htm loads with the geek_grrrl button down which is totally, totally cool. I am very impressed! Muchos Grathias!
I tried looking very hard at your code and then comparing it the code I have for some graphics based buttons I've made - see http://jeti.com.au/original/beta/html/yournewpage.htm as I'd like to perform the same trick using graphics for buttons versus CSS. Do you have any hints for me?
Finally, the naughtie code in http://jeti.com.au/original/beta/html/geek_grrrl2.htm doesn't work in Netscape (v4.6 for Mac). The rollovers don't work at all. Is this because it's based on layers?!?!
Kisses