Last active
August 29, 2015 14:16
-
-
Save DannyDelott/610aa01b0be48a4c78bb to your computer and use it in GitHub Desktop.
Fade out and change HTML, then fade back in.
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
var $content = $('.content'); | |
var $container = $('.container'); | |
var quotes = [ /* array of quotes */ ]; | |
var randomQuote = function(){ | |
return quotes[Math.floor(Math.random() * quotes.length)]; | |
}; | |
var changeQuote = function(){ | |
$content.fadeOut('slow', function(){ | |
$container.html(randomQuote()); | |
$content.fadeIn('slow'); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment