Skip to content

Instantly share code, notes, and snippets.

@cameck
Last active July 11, 2016 15:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cameck/6f4098a51b150212f9bd772f232cc57c to your computer and use it in GitHub Desktop.
Save cameck/6f4098a51b150212f9bd772f232cc57c to your computer and use it in GitHub Desktop.
Scroll to Page Location upon Completion of Ajax Request - Jquery
$( document ).ajaxComplete(function() {
// First we get the position of the ID we want
var topLocation = $('#copy-link').position().top;
// Then we scroll to it!
$('html,body').animate( { scrollTop: topLocation } , 1000 );
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment