Skip to content

Instantly share code, notes, and snippets.

@malachi358
Created March 17, 2015 10:21
Show Gist options
  • Save malachi358/d57fcf705bd01948709b to your computer and use it in GitHub Desktop.
Save malachi358/d57fcf705bd01948709b to your computer and use it in GitHub Desktop.
Loop Words with fadeIn and fadeOut jQuery
var words = ["A", "B", "C", "D"];
var showwords = function() {
var newword = words[Math.floor((Math.random() * words.length))]
$("#words").fadeOut( 1000, function() {
$("#words").text(newword).fadeIn(1000);
});
}
setInterval(showwords, 3000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment