我想添加圖像添加到元素之間的一段時間。這是我的代碼:將圖像延遲添加到div for for循環
<script>
var aantalkeergeklikt = 0;
var uniekeid = 0;
var pictures = ["../Spel in jQuery/img/bubbles/bom.png", "../Spel in jQuery/img/bubbles/green.png", "../Spel in jQuery/img/bubbles/red.png", "../Spel in jQuery/img/bubbles/yellow.png", "../Spel in jQuery/img/bubbles/orange.png", "../Spel in jQuery/img/bubbles/purple.png", "../Spel in jQuery/img/bubbles/blue.png"];
var size = pictures.length
for (i = 0; i < 20; i++) {
uniekeid = uniekeid + 1;
var x = Math.floor(size * Math.random())
var item = $("<img src='" + pictures[x] + "' alt='" + uniekeid + "' />").hide().delay("slow").fadeIn();
$('#depionnen').append(item);
console.log(item.alt);
}
</script>
此時,在添加所有圖像後應用延遲。
有人可以幫助我嗎?
謝謝!它現在有效。 – 2015-04-04 13:18:21
考慮接受別人知道的答案;) – Bram 2015-04-04 13:20:53