Skip to content

Instantly share code, notes, and snippets.

@panicbus
Created April 8, 2014 16:25
Show Gist options
  • Save panicbus/10151480 to your computer and use it in GitHub Desktop.
Save panicbus/10151480 to your computer and use it in GitHub Desktop.
JavaScript scrolldown
$('a').click(function(){
$('html, body').animate({
scrollTop: $( $(this).attr('href') ).offset().top - 100 //scrolls to anchor tag in body minus 100 px
}, 'slow');
return false;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment