SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Jun 2006
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    CSS nav with memory...

    Hi,

    I'm using a CSS/DHTML dropdown that doesn't use an imageswap...it's strictly text & hex based.
    I'm quickly coming to the realization that there's no memory to this nav.

    I mean, from page to page the navigation always looks exactly the same, it doesn't tell you which page your on.
    So unless your using breadcrumbs or something, the user can easily get lost on the site as they look back to the nav and find it all black.

    Here's the nav I'm using: www.cuush.com

    Now I know that I can name each button separately, and create a separate class for each one of them...
    then manually change the color per page/section of the website. Or alternately, keep a different stylesheet for each section of the site.

    But this seems like a whole lotta roundabout - just to change a button color.

    Can someone help me understand this part of CSS navigation?
    How do I give it memory without having to create three times as much CSS code as a basic javascript rollover?

    You have to assume that excessive amounts of code, whether they be CSS or HTML, will slow down a site.
    So there must be a technique to this, I just can't find a lead on it anywhere.

    Thx

  2. #2
    SitePoint Addict
    Join Date
    Nov 2004
    Location
    London
    Posts
    248
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You don't need to create a class for each button... but you do need to identify the "current" item in some way. This is typically done by adding:

    class="current" OR id="current"

    .. to the current item.

  3. #3
    SitePoint Member
    Join Date
    Jun 2006
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sweet...of course!

    Thank you soooo much for pointing that out!
    I just couldn't see it.

    So I wonder why none of the CSS navs that people create (publicly) have this class included?

    It took me two seconds to write it in and get it working, literally one line...
    yet it seems this script and all the the others I've tried are incomplete without it.

    Anyway, thanks again...life is good.

  4. #4
    SitePoint Addict
    Join Date
    Nov 2004
    Location
    London
    Posts
    248
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Delighted I could help!

    Quote Originally Posted by cUUsh

    [...] it seems this script and all the the others I've tried are incomplete without it.
    Entirely agree with you: showing the current "context" is so useful for the visitor.


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
  •