最简单的图像旋转器失败了,我怎样才能让它循环遍历数组?
$(document).ready(function () {
var source = ["images/designers1.jpg","images/designers2.jpg","images/designers3.jpg"];
i=0;
setInterval(function(){
$('.dimg').attr('src',source[i++])
}, 2000);
});