Reputation: 667
Once the page has finished loading, I would like one image to cross-fade to another. Not in a loop, just once.
The effect I would like to create can be seen here:
I am sure it must be quite simple using jQuery?
Thanks in advance
Upvotes: 0
Views: 1189
Reputation: 179
Try this:
$(document).ready(function(){
$(function() {
$('.byeIMG').fadeOut("slow");
$('.heyIMG').fadeIn("slow");
});
});
Upvotes: 0
Reputation: 887877
You can crossfade between two images by positioning them in the same place using CSS, then calling fadeIn()
and fadeOut()
using jQuery.
For example:
$(function() {
$('img.OldImage').fadeOut();
$('img.NewImage').fadeIn();
});
Upvotes: 1