我有一個rel="<img src"#"/>"
多個錨標籤。僅在第一次點擊時點擊動畫點擊?
當我點擊任何<a></a>
時,我使用淡入效果在另一個div中顯示rel
值的大圖。
我想要做的是檢查大圖像是否具有與錨點的rel
相同的src
,如果是,則防止fadeIn
效果。
$(document).ready(function() {
$("a.largeimg").click(function() {
var image = $(this).attr("rel");
$('.main-product-image').html('<img src="' + image + '"/>');
$('.main-product-image img').hide();
$('.main-product-image img').fadeIn();
return false;
if(src == image) {
$('.main-product-image img').show();
}
});
很難理解你的問題。試着讓它更清楚:)或者展示這個例子來更好地理解它。 –