Wednesday, 20 May 2015

How to Highlight the active navbar link with jQuery in Twitter Bootstrap .

<script>

    jQuery(document).ready(function () {
        var url = window.location;
        jQuery('ul.nav a[href="'+ url +'"]').parent().addClass('active');
        jQuery('ul.nav a').filter(function() {
             return this.href == url;
        }).parent().addClass('active');
    });

</script>

No comments:

Post a Comment

Alternative content