Created
September 30, 2015 22:14
-
-
Save christierney402/948f57f88792eb746b05 to your computer and use it in GitHub Desktop.
wait for all jQuery animations to complete then make the newly expanded section can be seen in the viewport
This file contains hidden or 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
$container = $('myElem'); | |
$(":animated").promise().done( function() { | |
if( $container[0].getBoundingClientRect().top < 50 ) { | |
$('html,body').animate({scrollTop: $container.offset().top}, 800); | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment