任何幫助,將不勝感激...幫助懸停功能
我想創建一個彩色照片褪色通過從黑色和白色的影響。淡入淡出的作品,但它的褪色的黑色和白色的第一個,我不想要... ID喜歡它出現好像顏色正在通過。然後,一旦它離開它,它應該恢復到我目前不做的原始圖形。
下面的代碼完美的作品除了我上面提到的部分...
//Loop through the images and print them to the page
for (var i=0; i < totalBoxes; i++){
$.ajax({
url: "random.php?no=",
cache: false,
success: function(html) {
// following line I originally suggested, but let's make it better...
//$('#bg').append(html).fadeIn('slow');
// also note the fine difference between append and appendTo.
var $d = $(html).hide().appendTo('#bg').fadeIn('slow');
$('img', $d).hover(function() {
var largePath = $(this).attr("rel");
$(this).fadeOut("slow", function() {
$(this).attr({ src: largePath }).fadeIn("slow");
});
});
}
});
}
謝謝格雷格,我注意到這已被編輯,但我無法看到變化?我粘貼的代碼,它並沒有改變! – Andy 2009-11-04 14:59:47