jquery - Bootstrap Left Navigation Menu with active class and border -
i want add active class on left menu when clicks on it. tried following if add e.preventdefault() link doesn't work , doesn't show output. if remove e.preventdefault() gives me output active class goes home. , add border in left menu . if have solution, let me know . here code
html file code
<ul class="nav nav-pills nav-stacked span2" > <li class="active"><a href="home.aspx">home</a></li> <li><a href="shreddingstatistics.aspx">shredding statistics report</a></li> <li><a href="shreddingdetailreport.aspx">shredding detail report</a></li> </ul>
jquery code
$(document).ready(function () { $(".nav.nav-pills.nav-stacked li").click(function (e) { e.preventdefault(); $(".nav.nav-pills.nav-stacked li").removeclass("active"); $(this).addclass("active"); }); });
Comments
Post a Comment