You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I call scroller.ScrollBy(..) during manual scrolling animation, it just doesn't work. So I have to wait until animation finishes and call ScrollBy one more time.
Is there a way to stop animation?
The text was updated successfully, but these errors were encountered:
Scrolling without animation:
Call scroller.stop() before you execute scroller.scrollBy()
Scrolling with animation
The problem ist here, the new animation starts before the old animation was completed.
In this case the property __isAnimating is set with the id of the new animation. And when the old animation is completed, then the new one will stopped because of this function call in the __publish method:
var wasAnimating = self.__isAnimating
if (wasAnimating) {
core.effect.Animate.stop(wasAnimating);
self.__isAnimating = false;
}
So you have to make sure that the new animation starts in a new request animation frame. So i add these lines in the __publish method:
window.requestAnimationFrame(function() {
// When continuing based on previous animation we choose an ease-out animation instead of ease-in-out
self.__isAnimating = core.effect.Animate.start(step, verify, completed, self.options.animationDuration, wasAnimating ? easeOutCubic : easeInOutCubic);
});
When I call scroller.ScrollBy(..) during manual scrolling animation, it just doesn't work. So I have to wait until animation finishes and call ScrollBy one more time.
Is there a way to stop animation?
The text was updated successfully, but these errors were encountered: