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

Ability to trigger event on animation start (after delay but before complete) #7

Open
heaversm opened this issue May 29, 2018 · 1 comment

Comments

@heaversm
Copy link

heaversm commented May 29, 2018

Hi - I have an animation chained with other animations:

elem.animate({
            delay: delay1,
            duration: duration1,
        })
        .opacity(1)
            .animate({
                delay:delay2,
                ease: '>',
                duration: duration2,
            })
            .fill({
                opacity: 0.3,
            })
            .during(function (pos, morph, eased, situation) {
                //this triggers at start of delay
            })
            .after((situation) => {
                //this triggers at end of anim
            });
});

And I want to trigger an event after the delay2, but before the second animation completes. Is this possible, or will I need to use a timeout or something?

@Fuzzyma
Copy link
Member

Fuzzyma commented May 29, 2018

you might want to just queue() a function which triggers the event. Like:

el.animate().queue(function () {
  // trigger event

  this.unqueue()
})

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