wait for all jQuery animations to complete then make the newly expanded section can be seen in the viewport
$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