Created
February 1, 2014 18:22
-
-
Save Soupala/8756274 to your computer and use it in GitHub Desktop.
A simple jQuery pattern for rotation through a series of html elements. Kind of like a carousel, but just for text or other overlays.
This file contains 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 rotates = $(".rotatetext"); | |
var rotateIndex = -1; | |
function showNextRotate() { | |
++rotateIndex; | |
rotates.eq(rotateIndex % rotates.length) | |
.fadeIn(900) | |
.delay(1800) | |
.fadeOut(900, showNextRotate); | |
} | |
$(document).ready(showNextRotate()); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment