weepy / jquery.path

Animatation for arcs and bezier curves with jQuery
http://weepy.github.com/jquery.path/
407 stars 79 forks source link

Can i stop animation before ending point? #32

Open ninmorfeo opened 5 years ago

ninmorfeo commented 5 years ago

Hi i created animation of unfolding cards along a one bezier curve. Can i stop animation before ending's point?

I would need to position the cards like a folding fan

weepy commented 5 years ago

can you just use jquery methods of stopping animation ?

On Thu, May 23, 2019 at 12:21 PM ninmorfeo notifications@github.com wrote:

Hi i created animation of unfolding cards along a one bezier curve. Can i stop animation before ending's point?

I would need to position the cards like a folding fan

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/weepy/jquery.path/issues/32?email_source=notifications&email_token=AAAAGNCEURYY4TOUWVSUBW3PWZ44FA5CNFSM4HO7LDS2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GVNZQSQ, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAAGNC4PCRBOSPTFDKBGQLPWZ44FANCNFSM4HO7LDSQ .

ninmorfeo commented 5 years ago

Yes i can but I can't understand where to enter the property detection of .square left property. this is the function:

$ (". square"). each (function () { for (var i in Paths [type]) { $ (this) .stop (). animate ({path: Paths [type] [i]}, 1000);

}

ninmorfeo commented 5 years ago

ok i find it: is right ?

$(".quadrato").each(function () { for (var i in Paths[type]) { $(this).stop().animate({path: Paths[type][i]}, { duration: 5000, step: function (now, fx) { console.log($(this).css('left'));
var pos_corrente=parseInt($(this).css('left'), 10);
if(pos_corrente>500) { $(this).stop(); } } });