好了,所以我有這樣的代碼:
$(this).find('article.loading').each(function(i) {
var el = this;
setTimeout(function() {
$(el).replaceWith($('#dumpster article:first'));
}, speed);
});
我想替換爲其他每個元素,但我想之間的延遲每更換。
我不明白爲什麼這不起作用,它只是在一次超時後將其全部替換掉。
任何想法?
謝謝。
不應該使用setInterval()而不是setTimeout()嗎? – 2011-12-08 02:45:36