diff --git a/animatedScrollTo.js b/animatedScrollTo.js index bc7d0cb..e93678b 100644 --- a/animatedScrollTo.js +++ b/animatedScrollTo.js @@ -33,7 +33,7 @@ lastpos = val; element.scrollTop = val; } - if (now > animationStart + duration) { + if (now > animationStart + duration || element.scrollTop == to) { element.scrollTop = to; animating = false; if (callback) { callback(); }