Created
June 1, 2011 18:18
-
-
Save codepunkt/1002918 to your computer and use it in GitHub Desktop.
jQuery - Bannerrotation, zufällig
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
$(function() { | |
var images = $('#banner').children(); | |
images.filter(':eq(' + ~~(Math.random() * images.hide().length) + ')').show(); | |
setInterval(function() { | |
var current = images.filter(':visible').fadeOut(), | |
next = (current.next().length ? current.next() : images.eq(0)).fadeIn(); | |
}, 2000); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment