我正在使用fadeToggle在循环中淡入淡出一些图像。有没有办法在图像1淡出后开始淡入图像2等等?
这是我正在使用的代码;
$(function() {
function run_animation($element, delay, duration) {
$element.delay(delay).fadeToggle(duration, function () {
run_animation($element, delay, duration);
});
}
run_animation($('.pointer1'), 1000, 1200);
run_animation($('.pointer2'), 3000, 1200);
run_animation($('.pointer3'), 4500, 1200);
run_animation($('.pointer4'), 6000, 1200);
run_animation($('.pointer6'), 7500, 1200);
run_animation($('.pointer7'), 9000, 1200);
run_animation($('.pointer8'), 10500, 1200);
});