Created
August 9, 2012 09:52
-
-
Save nterray/3302784 to your computer and use it in GitHub Desktop.
Outer Glow effect based on script.aculo.us Effect.Highlight
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
Effect.OuterGlow = Class.create(Effect.Highlight, { | |
setup: function() { | |
// Prevent executing on elements not in the layout flow | |
if (this.element.getStyle('display')=='none') { this.cancel(); return; } | |
this.oldStyle = { boxShadow: this.element.getStyle('box-shadow') }; | |
}, | |
update: function(position) { | |
this.element.setStyle({ boxShadow: '0px 0px ' + Math.round(30 - 30 * position) + 'px ' + this.options.startcolor }); | |
}, | |
finish: function() { | |
this.element.setStyle(this.oldStyle); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Need to use the options endcolor and to be able to change the blur radius (default to 30px)