Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
jQuery - Bannerrotation, zufällig
$(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
You can’t perform that action at this time.