rstacruz / jquery.transit

Super-smooth CSS3 transformations and transitions for jQuery
http://ricostacruz.com/jquery.transit
7.3k stars 864 forks source link

stop and go time issue #176

Open yshen65 opened 10 years ago

yshen65 commented 10 years ago

I am trying to use transition to stop and replay on demands . however I found that I can't fully clear the first transition by useing clearQueue();

this is my testing script I try to stop the first animation (which is set to run 10 sec) at t=7000 and replace it with a 4 sec run backward

$("#item").transition({"left":1200},10000,'linear'); // first animation setTimeout(function(){ $("#item").clearQueue();// stop the first one $("#item").transition({"left":100},4000,'linear'); //second animation },7000); //stop the first on t=7000

can start the second one with clearQueue()..however the transition jump to end at t=10000 (it should stop at 7000+4000=11000)

if not use clearQueue() ..it will stop at 7000 and wait another 3000 then start the second one..