Skip to content

Instantly share code, notes, and snippets.

@lucien144
Last active October 10, 2015 19:27
Show Gist options
  • Save lucien144/05a8314c366c1b017559 to your computer and use it in GitHub Desktop.
Save lucien144/05a8314c366c1b017559 to your computer and use it in GitHub Desktop.
Slide to HTML element
$('html, body').animate
scrollTop: $("#element").offset().top
, 2000
<script>
$(document).ready(function() {
$('html, body').animate({
scrollTop: $("#element").offset().top
}, 2000);
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment