Reputation: 10552
Hey all i am currently using this code below:
$('#tLight0').fadeTo(500,0.40, function() {
var theToTurn = $(this).attr('data-toTurn');
$(this).attr("src","site.com/Images/light_" + theToTurn + ".png");
}).fadeTo(300,1);
In order to cross fade my 2 images i have. However, the first image fades to about 40% transparent before the 2nd image begin to fade in.
What i am looking for is it to fade to (out) the first image and fade to (in) the second at the same time. Just like you see images being crossfaded.
I've tried all types of settings for fadeTo but it just doesnt seem to preform as how i just described it.
How can i modify my code above in order to get the results i am looking for?
Upvotes: 0
Views: 253
Reputation: 37701
Two images in the same container, absolutely positioned.
If you're going to 40%:
If you're going for a full fade (might be nicer)
Upvotes: 2