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'}); ...

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.