Team:Tokyo Tech/script

From 2014.igem.org

Revision as of 11:33, 17 October 2014 by Cerburus (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

$( document ).ready(function() {

 function slideshow(delayInSeconds) {
   var images = document.getElementsByClassName('image'),
       currentStep = 0;
   
   setInterval(nextImage, delayInSeconds * 1000);
   
   function nextImage() {
     TweenLite.to(images[currentStep % images.length], delayInSeconds/2, {opacity:0});
     TweenLite.to(images[++currentStep % images.length], delayInSeconds/2, {opacity:1});
   }
 }
 
 slideshow(7);

});