Staggering CSS Animations

后端 未结 3 1784
一个人的身影
一个人的身影 2021-01-07 12:41

I have a CSS animation that I want to be applied in 200ms intervals. I\'ve set up the CSS like this:

.discrete {
    position:relative;
    opacity:1;

    -         


        
3条回答
  •  长发绾君心
    2021-01-07 13:30

    You could use

    var els = $('.discrete'),
        i = 0,
        f = function () {
            $(els[i++]).addClass('out');
            if(i < els.length) setTimeout(f, 200);
        };
    f();
    

    Demo

提交回复
热议问题