Any help would be appreciated...
I am trying to create the effect of a colour photo fading through from black and white. The fade in works but its fading the black and white one OUT first which i dont want...id like it to appear as though the colour is coming through. Then once its hovered off of it should revert back to my original graphic which it doesnt currently do at all.
The code below works perfectly apart from the section i mentioned above...
//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");
});
});
}
});
}