Team:University College London/js/radio
From 2012.igem.org
(Difference between revisions)
Line 13: | Line 13: | ||
nextEpisode = episodes.first(); | nextEpisode = episodes.first(); | ||
} | } | ||
- | + | nextEpisode.animate({left:'728px'},2).show().animate({left:'0px'},400); | |
- | window.setTimeout(function() { | + | nextEpisode.delay(3).animate({left:'-728px'},400).animate({opacity:0},2,function(){currentEpisode = nextEpisode; window.setTimeout(function() { |
- | + | animateEpisodeIn(); | |
- | + | }, 5000);}); | |
}); }); | }); }); |
Revision as of 08:57, 15 August 2012
$(document).ready(function(){
var episodes = $('#slidecontainer').children(); episodes.first().show();
var currentEpisode = episodes.first();
function animateEpisodeIn(){ alert('a'); currentEpisode.find('.bg').animate({bottom:'0px',opacity:0.8},2000,function(){ currentEpisode.find('.desc').animate({opacity:1},1000,function(){ var nextEpisode = currentEpisode.next(); if(nextEpisode.length == 0){ nextEpisode = episodes.first(); } nextEpisode.animate({left:'728px'},2).show().animate({left:'0px'},400); nextEpisode.delay(3).animate({left:'-728px'},400).animate({opacity:0},2,function(){currentEpisode = nextEpisode; window.setTimeout(function() { animateEpisodeIn();
}, 5000);});
}); }); }
animateEpisodeIn();
});