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

deferring until after transition on chain? #211

Open
frumbert opened this issue Sep 9, 2014 · 1 comment
Open

deferring until after transition on chain? #211

frumbert opened this issue Sep 9, 2014 · 1 comment

Comments

@frumbert
Copy link

frumbert commented Sep 9, 2014

Say I have an effect with chaining

$(".thing").on("mouseover", function () {
    $(this).transition({scale: 1.2}, 1500).transition({perspective: '100px', rotateY: '180deg'}).css("border","2px solid red");
});

The "css" property set (changing border) is applied right away, whereas perspective is applied after scale as per the animation queue.

Is there a way to defer subsequent chained object execution until after all your transitions finish? E.g. scale, then flip, then add class? So then you could:

$(obj).transition({scale: 0}).hide();
@kilometers
Copy link

I could be crazy here, but it sounds like you can use the callback in the second .transition(...)

Here's what it could look like (untested)

$(".thing").on("mouseover", function () {
    $(this)
        .transition({scale: 1.2}, 1500)
        .transition({perspective: '100px', rotateY: '180deg'}, function(){$(this).css("border","2px solid red")}.bind(this));
});

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