Advertisement
BakerMan

jQuery Highlight Current Menu Item

Mar 29th, 2012
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * Find a link in an unordered list (such as a menu) and apply
  3.  * a CSS class (.active) to highlight the active item.
  4.  */
  5. jQuery('li:has(a[href="'+window.location+'"])').addClass('active');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement