任何帮助,将不胜感激...帮助悬停功能
我想创建一个彩色照片褪色通过从黑色和白色的影响。淡入淡出的作品,但它的褪色的黑色和白色的第一个,我不想要... 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