Results 1 to 4 of 4

Thread: keep main menus link "active" while sub menus links are being used.

  1. #1
    Join Date
    Mar 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation keep main menus link "active" while sub menus links are being used.

    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.

  2. #2
    Join Date
    Jun 2006
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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.

  3. #3
    Join Date
    Mar 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Understood, but how.

    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

  4. #4
    Join Date
    Mar 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •