Created
July 19, 2013 16:44
-
-
Save DWboutin/6040606 to your computer and use it in GitHub Desktop.
Boucle infini fadein fadeout slide
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var timer = setInterval(function(){ | |
for(var i = 0, liNbr = liEl.length; i < liNbr; i++){ | |
liEl.eq(i).css({left: liEl.eq(i).position().left + 1 }); | |
if(liEl.eq(i).position().left > liEl.eq(i).parent().width()){ | |
if(!liEl.eq(i).is(':animated')){ | |
liEl.eq(i).fadeOut(200, function(){ | |
$(this).css({left: '0px'}).prependTo($(this).parent()).fadeIn(200); | |
}); | |
} | |
} | |
} | |
}, 1000/60); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment