Skip to content

Instantly share code, notes, and snippets.

@DmmitryIs
Created January 4, 2019 14:33
Show Gist options
  • Save DmmitryIs/a2a96df2b1814b140463512cc4795800 to your computer and use it in GitHub Desktop.
Save DmmitryIs/a2a96df2b1814b140463512cc4795800 to your computer and use it in GitHub Desktop.
Scroll to element with jQuery
$([document.documentElement, document.body]).animate({
scrollTop: $('#needleElement').offset().top
}, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment