Using MooTools Fx in conjunction with onmouseover events

Mouseover actions are great and when combined with smooth effects, most users cannot distinguish them from flash objects.

Getting ready

The previous two recipes have prepared us to add effects to our mouseover, button-shows-image creation. After reviewing those two concepts of attaching the event listeners and altering unrelated DOM elements, we are ready to make the images appear in a milky smooth, moo-fashion.

How to do it...

Rather than making the images suddenly show up, we instantiate a moo-effect upon the DIV pic. Using that effect object, we fade in and out the opacity of the DIV as the images are added and removed.

$$('a').addEvents({ 'mouseover':function() { // if the pic is visible, ...

Get MooTools 1.3 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.