diff --git a/layout.js b/layout.js index 7eff08b..6d60061 100755 --- a/layout.js +++ b/layout.js @@ -206,6 +206,8 @@ var MIN_STEP = 0 // XXX make this a drop-in replacement for setElementTransform... // XXX cleanup, still flacky... function animateElementTo(elem, to, duration, easing, speed){ + // stop all ongoing animations on the current elem... + stopAnimation(elem) // use transition for animation... if(USE_TRANSITIONS_FOR_ANIMATION){ setTransitionEasing(elem, easing) @@ -371,7 +373,7 @@ function getMagazineOffset(page, scale, align){ function getPageNumber(page){ - // a page is given explicitly, get the next one... + // a page/element is given explicitly... if(page != null){ page = $(page) if(!page.hasClass('page')){