Skip to content

Instantly share code, notes, and snippets.

@jdcauley
Created July 8, 2014 12:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdcauley/9bf2ef3cc83491cda109 to your computer and use it in GitHub Desktop.
Save jdcauley/9bf2ef3cc83491cda109 to your computer and use it in GitHub Desktop.
jQuery Text Loop
$(function() {
var headline = $("#headline");
var copy = ['Entrepreneurs', 'Innovators', 'Industrialists', 'Disruptors'];
var position = -1;
!function loop() {
position = (position + 1) % copy.length;
headline.html(copy[position])
.fadeIn(1000)
.delay(3000)
.fadeOut(1000, loop);
}();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment