Learn free online HTML5, javascript, and jquery Tutorials by Examples

Thursday 26 May 2016

How can I offset scrollTop to take into account the height of a sticky header?

$('html, body').animate( { scrollTop: element.offset().top - $('#header').height(); }, {duration: 400 } );

No comments:

Post a Comment