Administrators Nathan Posted July 16, 2014 Administrators Share Posted July 16, 2014 I have a staic navigation bar.Right now "Home" is active. How can I adjust it so when I click "About" or "Team etc...then those nav options would become active?I know how to do it by checking the URL with PHP, but since these are not actual URL's but just jumping down to a div I'm not sure how to do it or best practice. Quote Link to comment Share on other sites More sharing options...
Administrators Nathan Posted July 16, 2014 Author Administrators Share Posted July 16, 2014 Fixed by adding this js snippet right before the closing </body> tag. <script> $(function() { $(".navbar-nav li").click(function(){ $(".navbar-nav li").removeClass("active") $(this).addClass("active") }) }) </script> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.