Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can i stop animation before ending point? #32

Open
ninmorfeo opened this issue May 23, 2019 · 3 comments
Open

Can i stop animation before ending point? #32

ninmorfeo opened this issue May 23, 2019 · 3 comments

Comments

@ninmorfeo
Copy link

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
Copy link
Owner

weepy commented May 23, 2019 via email

@ninmorfeo
Copy link
Author

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
Copy link
Author

ninmorfeo commented May 23, 2019

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();
}
}
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants