Skip to content

Instantly share code, notes, and snippets.

@nterray
Created August 9, 2012 09:52
Show Gist options
  • Save nterray/3302784 to your computer and use it in GitHub Desktop.
Save nterray/3302784 to your computer and use it in GitHub Desktop.
Outer Glow effect based on script.aculo.us Effect.Highlight
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);
}
});
@nterray
Copy link
Author

nterray commented Aug 9, 2012

Need to use the options endcolor and to be able to change the blur radius (default to 30px)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment