Skip to content

Instantly share code, notes, and snippets.

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 alekskravchenko/d5208073558274e7ecc197f67ad19e42 to your computer and use it in GitHub Desktop.
Save alekskravchenko/d5208073558274e7ecc197f67ad19e42 to your computer and use it in GitHub Desktop.
Word rotate
var wordRotateIndex = 0;
function wordRotate() {
var i;
var x = document.getElementsByClassName("rotating-word");
for (i = 0; i < x.length; i++) {
$(x[i]).hide();
}
wordRotateIndex++;
if (wordRotateIndex > x.length) {
wordRotateIndex = 1;
}
$(x[wordRotateIndex - 1]).stop().fadeIn(600);
setTimeout(wordRotate, 2000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment