tweaking of the ribbon scroll...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2014-02-04 18:23:11 +04:00
parent 8a3bbc493a
commit 21d866f51c

View File

@ -447,8 +447,12 @@ function animateElementTo(elem, to, duration, easing, speed, use_transitions){
left: to.left - from.left, left: to.left - from.left,
} }
elem.animating = true elem.animating = true
elem.next_frame = null
function animate(){ function animate(){
if(elem.next_frame === false){
return
}
var t = Date.now() var t = Date.now()
// end of the animation... // end of the animation...
if(t >= then){ if(t >= then){
@ -517,6 +521,7 @@ function animateElementTo(elem, to, duration, easing, speed, use_transitions){
function stopAnimation(elem){ function stopAnimation(elem){
if(elem.next_frame){ if(elem.next_frame){
cancelAnimationFrame(elem.next_frame) cancelAnimationFrame(elem.next_frame)
elem.next_frame = false
} }
} }