【发布时间】:2013-03-15 09:32:21
【问题描述】:
我的网站中有一些图片,我想使用这段代码隐藏它们,更改显示的图片并将它们显示回来,但新图片会立即显示。我不知道该怎么办。
这是javascript:
$(document).ready(function() {
$('.show').click(function() {
$(this).removeClass("show").addClass("clickedShow");
$('.show').animate({opacity: 0}, 1000);
$(this).delay(1000).animate({opacity: 0}, 1000);
$(this).animate({opacity: 1}, 1000).attr("src", "pic2.png");
$('.show').delay(1000).animate({opacity: 1}, 1000).attr("src", "pic2.png");
});
});
【问题讨论】:
标签: javascript jquery