Created
August 20, 2012 15:47
-
-
Save cam-gists/3405276 to your computer and use it in GitHub Desktop.
JQuery: Progressive Fade 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
/* | |
Plugin: Progressive Fade In | |
Version: 1 | |
Author: Tim Wright - csskarma.com | |
Call: $(elems).progressiveFadeIn({ 'speedMultiplier': ###, 'fadeInSpeed': ### }); | |
Options: speedMultiplier, fadeInSpeed | |
URL: http://www.csskarma.com/lab/jquery.plugins/jquery.progressiveFadeIn.js | |
*/ | |
(function ($) { | |
"use strict"; | |
$.fn.progressiveFadeIn = function (options, callback) { | |
var defaults = { | |
speedMultiplier : 250, | |
fadeInSpeed : 500 | |
}, | |
options = $.extend(defaults, options), | |
items = $(this), | |
count = items.length, | |
i; | |
if (count > 0) { | |
for (i = 0; i < count; i = i + 1) { | |
var obj = items[i], | |
delayTimer = defaults.speedMultiplier * i; | |
$(obj).hide().delay(delayTimer).fadeIn(defaults.fadeInSpeed); | |
} // for | |
} // if | |
}; // fn | |
}(jQuery)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment