這裏是我的javasript:改變圖像不工作
$(function() {
$(".image2").click(function() {
var image = $(this).attr("rel");
$('#random_img').hide();
$('#random_img').fadeIn('slow');
$('#random_img').attr('src') == image;
var image2 = $('#random_img').attr('src');
$("#thumb2 a img").removeClass("open");
$("#thumb2 a[rel='" + image2 + "'] img").addClass("open");
return false;
});
});
這裏是我的html:
<div id="image2">
<img id="random_img" src="/documents/templates/projedepo/banner/indigovision.jpg" height="420" width="964" />
</div>
<div id="thumb2">
<a href="#" rel="/documents/templates/projedepo/banner/canon.jpg" class="image2">
<img title="Canon" class="slider_thumb" src="/documents/templates/bilgiteknolojileri/images/t_flash/t1.png" border="0"/></a>
<a href="#" rel="/documents/templates/projedepo/banner/indigovision.jpg" class="image2">
<img title="IndigoVision" class="slider_thumb" src="/documents/templates/bilgiteknolojileri/images/t_flash/t2.png" border="0"/>
</a>
</div>
當我的縮略圖,動畫淡入點擊和隱藏的作品,但形象沒有改變......爲什麼?