MooTools Fader Class

While this is a very basic piece of code it adds a very nice effect to any item you choose. The MooTools Fader Class will fade any item to a specified opacity and fade it back to a specified opacity.

Usage

new Fader(elements);

Parameters and Options

elements: Parameter. This is a CSS selector that will be used to select your items.
fadeTo: Option. This is the decimal value that your item will be faded to. E.G. 0.3
fadeFrom: Option. This is the decimal value that your item will be faded back to. E.G. 1
duration: Option. The speed of the animation in milliseconds. E.G. 250
transition: Option. The transition of the animation. E.G. Fx.Transitions.Sine.easeOut

Demo and Download

You can see it in action here.
Download a zip here.

Popular Posts

Help The Javascript Blog

If you would like to write for The Javascript Blog or submit a plugin or class please feel free to contact us.


Leave Your Response

* Name, Email, Comment are Required