Make Twitter Bootstrap navbar link active

前端 未结 9 955
情深已故
情深已故 2020-11-30 21:33

What\'s the standard way to make the active link in a Twitter Bootstrap navbar bolded? It\'s clear that a link gains the active appearance by gaining the \"active\" class. F

9条回答
  •  有刺的猬
    2020-11-30 21:56

    http://totalprogus.blogspot.sk/2013/12/bootstrap-add-active-class-to-li.html

    This tutorial has a great and ultimate solution for this "problem". I was dealing with it a while ago and working great for me, customizable as well

    $(document).ready(function() {
        $('a[href="' + this.location.pathname + '"]').parent().addClass('active');
    });
    

提交回复
热议问题