K
K
KlimMalgin2014-01-12 08:51:10
JavaScript
KlimMalgin, 2014-01-12 08:51:10

How to organize consecutive animations in AngularJS?

I create js animations in an angular project in the usual way:

angular.module('animations', [])
    .animation(".slideshowAnimation", function () {
        return {
            leave: function (element, done) { /* leave-animation */ },
            enter: function (element, done) { /* enter-animation */ }
        };
    });

But in this case, when m / d routes transitions, all animations on the page are performed simultaneously. And I need several elements on the page to animate one after another during transitions. Tell me how can this be done?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Ruslan Lopatin, 2014-01-12
@KlimMalgin

You can specify transition-delay in animation classes so that the next animation starts when the previous one ends.
The same can be done programmatically, in the enter or addClass animation function.
Well, in the end, the animation itself can be launched programmatically, for example, by an event generated at the end of the previous animation. See $animate

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question