有没有办法在循环效果中等待旋转木马滑块,直到下一个图像被下载。现在,我对carousel使用下面的代码。
$('#myCarousel').carousel({
interval:4000
});上面的代码按时间间隔工作,但不会等到下一个图像完全加载。
发布于 2014-12-25 12:57:04
旋转木马不会等到下一张幻灯片的图像加载完毕。但你可以做的一件事是,你可以在运行时生成carousel的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);https://stackoverflow.com/questions/27644160
复制相似问题