Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

changing the active class on press

$(document).ready(function () {
    $('.nav li a').click(function(e) {

        $('.nav li.active').removeClass('active');

        var $parent = $(this).parent();
        $parent.addClass('active');
        e.preventDefault();
    });
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #changing #active #class #press
ADD COMMENT
Topic
Name
9+8 =