我已经创建了这个DEMO我的问题。jquery在鼠标悬停的交换图像库
在我的演示中,您可以看到当您用鼠标悬停在缩略图图像上时,更大的图片正在改变。我想要什么?我想在几秒钟后自动更改图像。
我需要为它做些什么?任何人都可以帮助我?
$(document).ready(function() {
$("#magazin_sldwr li img").hover(function(){
$('#mainm-img').attr('src',$(this).attr('src').replace('thumb/', ''));
});
var imgSwap = [];
$("#magazin_sldwr li img").each(function(){
imgUrl = this.src.replace('thumb/', '');
imgSwap.push(imgUrl);
});
$(imgSwap).preload();
});
$.fn.preload = function() {
this.each(function(){
$('<img/>')[0].src = this;
});
}