/ Published in: jQuery
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$(function(){ $('.fadein img:gt(0)').hide(); setInterval(function(){ $('.fadein :first-child').fadeOut() .next('img').fadeIn() .end().appendTo('.fadein');}, 3000); }); // HTML Markup <div class="fadein"> <img src="http://farm3.static.flickr.com/2610/4148988872_990b6da667.jpg"> <img src="http://farm3.static.flickr.com/2597/4121218611_040cd7b3f2.jpg"> <img src="http://farm3.static.flickr.com/2531/4121218751_ac8bf49d5d.jpg"> </div> // CSS .fadein { position:relative; width:500px; height:332px; } .fadein img { position:absolute; left:0; top:0; }
URL: http://snook.ca/archives/javascript/simplest-jquery-slideshow