andrei
andrei

Reputation: 8582

jquery fadeIn/out images

I want to switch between 3 pictures fading in and out between them but i really have no idea how to approach this. So i have

$('<div id="container"></div>').appendTo('body');  
$('#container').html('<img src="1.jpg" />').hide().fadeIn(1500);  

Where do i go from here ? Multiple suggestions are more then welcomed :D thx

I was thinking of animating to opacity : 1 after the image has loaded or using timeout to pause between images

Upvotes: 0

Views: 116

Answers (1)

Nick Craver
Nick Craver

Reputation: 630349

You can write this yourself minimally, but it's at least worth checking out the jQuery Cycle Plugin for this.

You can write a less-code/no-frills version, but if you find you like to have additional effects/options, check out the cycle plugin, no reason to re-write it yourself...it's already widely used/supported.

Upvotes: 2

Related Questions