Smart Navigation with jQuery
In my first tutorial, learn how to create a menu that knows where you are by dynamically adding classes to your navigation.
In my first tutorial, learn how to create a menu that knows where you are by dynamically adding classes to your navigation.
November 6th, 2008 at 12:57 pm
Nice tut Chris.
The jQuery part could be shortened though:
$(function(){
$(’#nav a’).click(function(){
$(this).parent().addClass(’selected’).siblings(’li’).removeClass(’selected’);
});
});