I\'m trying to build a new trendy one page website where I scroll to a section on the page. I want to bring the \"fixed\" header to exactly where the content is. I am usin
There's a plugin for that.
Or just roll your own.
If you need to offset the "roll your own" solution then try the following:
$("#button").click(function() { var offset = 20; //Offset of 20px $('html, body').animate({ scrollTop: $("#elementtoScrollToID").offset().top + offset }, 2000); });