SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Feb 2011
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question How to use jQuery to dynamically change navigation

    I would like to change the look of a navigation button that lets the user know they are on that page. I am wondering if there is a way to dynamically change the button to have an .active class instead of hard coding .active on each page.

    Any suggestions?

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,682
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by wycomm View Post
    I would like to change the look of a navigation button that lets the user know they are on that page. I am wondering if there is a way to dynamically change the button to have an .active class instead of hard coding .active on each page.

    Any suggestions?
    Here's an effective way from CSS-Tricks:
    ID Your Body For Greater CSS Control and Specificity
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Tags for this Thread

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
  •