开发者

jQuery how to make delayed appending inside a loop?

Would like to append rows in a small p开发者_如何学Pythoneriod.

Couldn't do that. :)

Maybe someone here could demonstrate that?

Would be very grateful.


you could use window.setTimeout as described here on the mdc.


In theory, something like this:

var timer = 0;
var items = $(".item").hide().each(function() {
    var el = $(this);
    timer += 250;
    window.setTimeout(function() {
        el.show();
    }, timer)
});


You can use setInterval().

Example:

setInterval(function() {
    // this will be executed every 1000ms
}, 1000);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜