To make the clicked tab active in the navigation bar, the <li> corresponding to the clicked href in index.html introduces the css of 'active' class and removes the 'active' class from the previous <li> on click.
Example:
index.html
<ul class="nav navbar-nav navbar-right menul">
<li class="active"><a href="#">HOME</a></li>
<li><a href="about">ABOUT</a></li>
<li><a href="services">SERVICES</a></li>
<li><a href="register">REGISTER</a></li>
<li><a href="contact">CONTACT</a></li>
</ul>
abc.js
$(document).ready(function(){
$('li').click(function() {
$("li.active").removeClass("active");
$(this).addClass('active');
});
0 Comment(s)