我想在鼠标上滑动显示图像(json数组中的所有图像),我只需要更改img src。在这个数组中,图像的大小不同。有些是256X256,有些是436x436。
但对于大图像,它在firefox上给出错误 "图像损坏或截断:http://localhost/product/9cca72417668f1d813dcbc815a8ddb63.jpg"
我有以下代码:
jQuery('.sales-product-images').on('mouseover',function(){
var counter = 0;
var selector = jQuery(this);
var pd_id = jQuery(this).attr('id');
var imageArray = jQuery.parseJSON(images);
var product_images= imageArray[pd_id];
default_image = product_images[product_images.length - 1];
timer = setInterval(function() {
selector.fadeOut("slow",
function () {
if (counter === product_images.length) {
counter = 0;
}
selector.attr('src', image_path_front + 'product/' + product_images[counter]);
selector.show();
counter = counter+ 1;
});
});
}, 2300);
我想要显示另一个图像,如果一个完全加载或如果不可能那么我可以显示加载图像,直到其他图像未加载.. 请帮我。