我怎样才能让这个动画从头开始连续重复? http://jsfiddle.net/philoman/RuX5d/8/
$(document).ready(function() {
var i = 1, dir = 1, curFx = 'fadeIn';
var interval = setInterval(function () {
if (i == 2 && $('#slide1').is(':visible')) {
$('#slide1').fadeOut(6000);
return;
}
$('#slide'+ i)[curFx](1500);
i = i + 1*dir;
if (i == 10 || i == -1) {
dir = (dir == 1)?-1:1;
curFx = (curFx == 'fadeIn')?'fadeOut':'fadeIn';
}
}, 1500);
});