Created
September 26, 2009 12:52
-
-
Save peteroome/194216 to your computer and use it in GitHub Desktop.
The Javascript used to make each item in the given list fade in and out.
This file contains hidden or 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
| $(function(){ | |
| $('body').removeClass('js-disabled').addClass('js-enabled'); | |
| $('#quotes').flashQuotes(); | |
| }); | |
| $.fn.flashQuotes = function(){ | |
| return this.each(function(){ | |
| var quotes = $('>li',this); | |
| quotes.not(':first').hide(); | |
| var timer = window.setInterval(function(){ | |
| quotes.filter(':visible').fadeOut(function(){ | |
| if ($(this).is(':last-child')) { | |
| quotes.eq(0).fadeIn(); | |
| } else { | |
| $(this).next('li').fadeIn(); | |
| } | |
| }); | |
| },3000); | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment