d-oliveros / ngSmoothScroll

AngularJS directives for animating smooth scrolling to elements.
276 stars 112 forks source link

scroll getting stuck at the bottom of the page #74

Open mbirnbaum opened 8 years ago

mbirnbaum commented 8 years ago

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()

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!!!