I am calling the scroll-to for a few points in a scroll container. When I scroll to the point at the bottom of the container, I can't scroll back up because the animation is stopping it. I see this is because the internalHeight >= scrollHeight in the stopAnimation()
I am calling the
scroll-to
for a few points in a scroll container. When I scroll to the point at the bottom of the container, I can't scroll back up because the animation is stopping it. I see this is because theinternalHeight >= scrollHeight
in thestopAnimation()
if ( ( // condition 1 position == endLocation ) || ( // condition 2 currentLocation == endLocation ) || ( // condition 3 internalHeight >= scrollHeight ) ) { // stop clearInterval(runAnimation); callbackAfter(element); }
How can I fix this? I need to go back to the top of the page!!!