Take the 2-minute tour ×  Trying to make the browser scroll to a
specific ID with an added offset -  $('html,
body').animate({scrollTop: $('#contact').offset().top}, 'slow');
What I need to do is to set the offset by -100px. How can I
accomplish this?  share|improve this question add comment  2
Answers  up vote 15 down vote accepted  No magic involved, just
subtract from the offset top of the element  $('html,
body').animate({scrollTop: $('#contact').offset().top -100 },
'slow'); share|improve this answer God, it was that easy... I
feel like a 10 year old. –  Staffan Estberg Mar 8 '12 at 14:40
Use window.innerHeight to determine the user's screen height. – 
Phillip Aug 15 at 16:07 @Phillip what does screen height have to
do with anything in this instance? –  charlietfl Aug 15 at 16:31
If the page is long, and you have a submit button at the bottom
of the page, you can scroll to the submit button and stop at the
bottom of the user's visible window. –  Phillip Aug 15 at 16:57
@Phillip The form is not optimal.