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