Last active
July 11, 2016 15:33
-
-
Save cameck/6f4098a51b150212f9bd772f232cc57c to your computer and use it in GitHub Desktop.
Scroll to Page Location upon Completion of Ajax Request - Jquery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$( 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