Jump to content

Recommended Posts

  • Administrators
Posted

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.

  • Administrators
Posted

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>

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...