jquery each add class with delay inbetween

前端 未结 3 793
鱼传尺愫
鱼传尺愫 2021-02-04 15:32

I need to loop through each div .row to add or remove a flip class that has a CSS3 3D transform effect.

When I apply this add/remove class to each \".row\" with jquery e

3条回答
  •  情歌与酒
    2021-02-04 16:17

    You have to use setTimeout to do a delay effect.

    Here is jsFiddle: http://jsfiddle.net/xQkmB/1/

    var i = 0;
    var rows = $(".row");
    show();
    
    function show() {
        if (i < rows.length) {
            $(rows[i]).show();
            i++;
            setTimeout(show, 1000);
        }       
    }
    

提交回复
热议问题