Created
June 3, 2010 21:29
-
-
Save andrew8088/424522 to your computer and use it in GitHub Desktop.
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
(function ($) { | |
$.fn.chromeFade = function (opts) { | |
var defs = { msTilFade : 2000, fadeSpeed : 500, fadeTo : 0.01 }, | |
sets = $.extend({}, defs, opts), | |
elems = this, | |
fadeFunc = function () { | |
elems.fadeTo(sets.fadeSpeed, sets.fadeTo); | |
}, | |
fadeTimer = setTimeout(fadeFunc, sets.msTilFade); | |
$(document).mousemove(function () { | |
elems.fadeTo(100, 1.0); | |
clearTimeout(fadeTimer); | |
fadeTimer = setTimeout(fadeFunc, sets.msTilFade); | |
}); | |
} | |
}(jQuery)); | |
// example : http://jsbin.com/avedu3/5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment