誰かがrandom.phpページから画像をプリロードして、最初にロードしたときにフェードインする方法を理解するのを手伝ってもらえますか?現在、プリロードされていないため、醜いバルクエコーが発生しますが、ページが実行されると、次々に完全にフェードオンします...
//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");
});
});
}
});
}