有没有办法在循环效果中等待Carousel滑块,直到下载下一张图像。 现在我使用下面的代码转盘。
$('#myCarousel').carousel({
interval:4000
});
以上代码处理时间间隔但不等到下一个图像完全加载。
答案 0 :(得分:1)
旋转木马无法等到下一张幻灯片加载图像。但你可以做的一件事就是你可以在运行时生成旋转木马的img标签,如下所示,你可以使用它的onload事件:
var theImage = new Image();
theImage.src = encodeURI(ImagePath);
theImage.onload = function () {
$('#myCarousel').carousel('next') \\this statement will slide to next after image is loaded
}
$('body').append(theImage);