Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 2 of 2

Thread: selected state for top nav links

  1. #1
    kblake@mainstreet is offline Junior Member
    Join Date
    Sep 2008
    Posts
    29

    Default selected state for top nav links

    Wondering if anyone knew how to get a selected state for the current page you're on, so for example if I clicked "home" the background for home link in the top Nav would be redish color. Here's the website I'm working on, http://www.fursbyrussell.com/?skinid=2

  2. #2
    ROBB is offline Senior Member
    Join Date
    Jun 2011
    Location
    United States
    Posts
    107

    Default Javascript For Active State Selection

    You could use javascript to determine the current page name.

    If the menu is being dynamically generated:
    As each menu item is rendered (home, about us, services, buying new...etc) compare it to the current page name, and conditionaly apply a class for the active item. I.E. if current page name = menu item being rendered, apply class "active".

    For static menus:
    See this jquery example: http://stackoverflow.com/questions/5...-state-on-menu
    Last edited by ROBB; 06-30-2011 at 02:34 PM.