我想创建一个效果,你点击一个缩略图图像,链接到缩略图将取代主图像,但淡入它。这是我的代码目前正在使用:jQuery改变图像src与淡入淡出效果
$(".thumbs a").click(function(e) {
e.preventDefault();
$imgURL = $(this).attr("href");
$(".boat_listing .mainGallery").fadeIn(400, function() {
$(".boat_listing .mainGallery").attr('src',$imgURL);
});
});
这可以工作并替换没有淡入淡出效果的图像。我需要改变什么才能使淡入效果起作用?
我有同样的问题;感谢您的修复。 – 2014-04-15 15:36:37
我在为Firefox进行fadeIn/fadeOut工作时遇到了问题。该解决方案适用于所有浏览器。谢谢! – DIG 2015-04-09 17:53:33
这对我更好。谢谢! – 2015-06-18 07:24:23