Simple Prototype Slideshow


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. setInterval(function(){
  2. var imgs = $$('.fadein img'),
  3. visible = imgs.findAll(function(img){ return img.visible(); });
  4. if(visible.length>1) visible.last().fade({ duration: .3 });
  5. else imgs.last().appear({ duration: .3,
  6. afterFinish: function(){ imgs.slice(0,imgs.length-1).invoke('show'); } });
  7. }, 3000);

URL: http://snook.ca/archives/javascript/simplest-jquery-slideshow#c64389

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.