Menu and sections

Menu and sections
0

#1

When you click on the menu and go to the selected section, the page don’t stop in the beggining of the section. Why?

Look:


#2

You need to adjust for the navbar height.

$('[href*="#"]').click(function() {
	var target = $(this.hash);
	var navBarHeight= $(".navbar-fixed-top").height(); // gets navbar height
	console.log(headerHeight)
	$('html, body').animate({
		scrollTop: target.offset().top - navBarHeight// subtracts height to position correctly
	}, 1000);			
});

#3

Thank you!!!
I need to study JS more hahaha