Skip to content

Instantly share code, notes, and snippets.

@juliocesar
Created December 14, 2009 04:00
Show Gist options
  • Save juliocesar/255765 to your computer and use it in GitHub Desktop.
Save juliocesar/255765 to your computer and use it in GitHub Desktop.
;(function($) {
$.progressiveFade = function(element) {
var childTag;
switch($(element).get(0).tagName) {
case 'DIV':
childTag = 'div';
break;
case 'UL':
childTag = 'li';
break;
};
var children = $(element).find('> ' + childTag);
(function(elt) {
$(elt).fadeOut();
var method = arguments.callee;
if ($(elt).next().length) {
setTimeout(function() {
method($(elt).next());
}, 1000);
}
})(children[0]);
};
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment