JS Fiddle 位于此处:http: //jsfiddle.net/8nqkA/2/
HTML
<div>
<div class="show">Test 1</div>
<div class="hidden">Test 2</div>
<div class="hidden">Test 3</div>
<div class="hidden">Test 4</div>
</div>
jQuery
$(document).ready(function() {
myFunc($(".show"));
});
function myFunc(oEle)
{
oEle.fadeOut('slow', function(){
if (oEle.next())
{
oEle.next().fadeIn('slow', function(){
myFunc(oEle.next());
});
}
else
oEle.siblings(":first").fadeIn('slow', function(){
myFunc(oEle.siblings(":first"));
});
});
}
CSS
.hidden {
display: none;
}
试图让它在完成后循环回测试 1,但不起作用。只想让它重新开始,这有什么问题?