Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A properly way to do scrollTop. It's correct for positive and negetive element's offsetY
var body = $('.modal-body');
body.animate({
scrollTop: body.scrollTop() + error.offset().top - 65
}, 500);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment