javascript - bootstrap navigation active links not working -
i'm trying make navigation active on active div, following example shows , hides correct divs doesn't add active class link:
html
<div class="list-group" id="admin-list"> <a href="#add-user" data-toggle="tab" class="list-group-item"> add user </a> </div>
js
$("#nav li a").on("click", navigation("#nav li")); $("#admin-list a").on("click", navigation("#admin-list a")); var foo = function(navigation) { $(navigation).removeclass("active"); //remove "active" li $("#home, #about, #contact", "#add-user").hide(); //hide "pages" $($(this).prop("href")).show(); //show current target $(this).addclass("active"); //set click active };
i think problem lies within
($(this).prop("href")).show();
because not valid selector. if trying current link reference this:
$(this).show();
Comments
Post a Comment