我正在尝试实现幻灯片效果,但图片似乎没有重绘,这是否与我如何循环此功能有关?
这是片段:
function changePic() {
if (n == pics.length) {
pics = shuffleArray(pics);
n = 0;
}
var pic = "media/" + pics[n];
n++;
$("#dinner").fadeOut("slow",function(){
$("#dinner").attr("src",pic).load(function(){
$("#dinner").fadeIn("slow",function(){
setTimeout(changePic,slideDuration);
});
});
});
}