O'Reilly logo

MooTools 1.3 Cookbook by Jay Larry G. Johnston

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required