Created
September 27, 2011 13:57
-
-
Save rutger1140/1245104 to your computer and use it in GitHub Desktop.
An old javascript I used for setting active menu classes (with @ppk his W3CDOM checker)
Currently I use this one, with jQuery (by Remy Sharp - http://docs.jquery.com/Tutorials:Auto-Selecting_Navigation)
$(function(){
/* Find active menu item */
var path = location.pathname.substring(1);
if(path)
$('#secondary a[href$="' + path + '"]').parent("li").attr('class', 'active');
});
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is obviously more for reference sake, than to show off my l33t skills =]