I would want the quotes to start fading in/out and get to the next one after just clicking the screen. The way it is now, the first quote starts before I get to that page and it's a bit confusing. It's a scrolling website.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>
(function() {
var quotes = $(".quotes");
var quoteIndex = -1;
function showNextQuote() {
++quoteIndex;
quotes.eq(quoteIndex % quotes.length)
.fadeIn(2500)
.delay(2200)
.fadeOut(4500, showNextQuote);
}
showNextQuote();
})();
</script>
If you want it to wait for a click then don't automatically run
showNextQuote()
on the last line. Add it into a click event:To show the first automatically:
Then it will require a click for the next one to start.