0
所以我有3张图片,当用户点击它时,它会变成另一张图片。但我想添加一个jQuery fadeOut
和fadeIn
以给出切换过程的转换效果。这是我想出来的,但它不起作用,有什么想法?jquery fadeIn和fadeOut不工作
$(".chosen").click(function() {
var src = $(this).attr("src");
if (src == "blank.png") (function() {
$(this).fadeOut(400);
{
$(this).attr("src", "ex.png").fadeIn(400);
}
});
else if (src == "ex.png") (function() {
$(this).fadeOut(400);
{
$(this).attr("src", "oh.png").fadeIn(400);
}
});
else (function() {
{
$(this).fadeOut(400);
$(this).attr("src", "blank.png").fadeIn(400);
}
});
});
谢谢你,它的工作吧! – 2013-03-09 03:39:40