Log in

View Full Version : keep main menus link "active" while sub menus links are being used.



goonster
03-29-2007, 02:48 PM
I was wondering if any of you guys (n gals) might know how I can
fix the following problem.

I have my main menu driven by java script that at present uses ‘CSS’ to tell:

a.menul:active{
color: #cccccc;

Thus changing the link text color to grey so visitors know which page they are viewing.

Now my problem is that whenever I click anywhere else other than the main menu, the active status of the last clicked link is reverted back to its normal color.

How can this be fixed?
Any ideas?

Regards
T.

cbulmer
04-04-2007, 12:01 AM
you cant do this using :active, you would have to use javascript to change the id to something else, and that different id has different css styling. Thats the only way I can think of, and I cant really show you how to do it at the moment.

goonster
04-28-2007, 07:41 PM
Understood, I’ve looked high and low and I’m unable to find any scripts or tutorials that do this.

Can anyone advise me?

Many thanks
G

justforki
05-02-2007, 11:51 PM
body tag...
<body class="home">

Menu (mainNav)
<li><a href="/index.php" id="home">Home</a></li>
...

CSS
body.home #mainNav a#home{
...Your CSS here....
}

Hope it helps
Tiki