Bogdan Verbenets
Bogdan Verbenets

Reputation: 26946

fade out one image, fade in second

I want one image to slowly fade out, while the second image slowly fades in. Both images should be at the same position ofcourse. How can I achieve this without setting their styles to position: absolute?

Upvotes: 0

Views: 469

Answers (1)

stephen776
stephen776

Reputation: 9234

try something like...

$('imageOneSelector').fadeOut(1000, function(){
   $(this).replaceWith(new image html);
   $('imageOneSelector').fadeIn(1000);
});

UPDATE:

heres a jsfiddle test without the images but should be the same concept...

http://jsfiddle.net/qWngq/1/

Upvotes: 2

Related Questions