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

Making mouseover elements grow on a ribbon

Ribbons often have a rollover effect; let's duplicate this effect for our ribbon.

Getting ready

Be sure to review the previous recipe as it goes through all the intricacies of the sliding task-bar ribbon used in this example.

How to do it...

What is new in this recipe begins with the comment "// make the growth and shrinkage quick". There are three things that we have to accomplish, the first is placing listening events on the mouseover and mouseout. We use the MooTools custom events mouseenter and mouseleave, which help us avoid event bubbling.

... <script type="text/javascript"> // ribbon slide in/slide out effects ... // make the growth and shrinkage quick $$('#ribbon a img').set('morph',{duration:'short'}); ...

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