<分区>
最佳答案
这是我做的一个 fiddle ,就是这样工作的
请记住,不透明度可能对 IE 有一些问题
编辑:不需要 setTimeout(),我只是把它放在那里以在运行脚本时获得一些延迟
代码:
var timeArray = [200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800];
setTimeout( function() {
$('.box').each( function ()
{
var intVal = Math.floor((Math.random()*12));
$(this).animate({ top: 0, opacity: 1 }, timeArray[ intVal ]);
});
}, 500);
CSS:
.box
{
opacity: 0;
height: 100px;
width: 100px;
position: relative;
top: 40px;
margin: 20px;
border: 1px solid #333;
float: left;
}
html:
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
关于jquery - 无法复制效果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20635865/