Elegant Menu Mootools Plugin
If you didn’t want to follow along in my elegant menu tutorial, then you’re in luck. I made it into a Mootools plugin. You can try out the demo or download it (script and css). This plugin is built to work with Mootools 1.2b2.
New features include automagic calculation of widths so you no longer need to define them in the css if you don’t want to. Additionally, you can attach your own events when the menus are shown and hidden, and it’s easier to change the speed of the animation (sorry, you can’t change the type). The css file is also organized a lot better, allowing you to located exactly what you can and can’t change.
Here are some examples that detail your options:
// default usage new EMenu('id_of_container'); // change speed of animation new EMenu('id_of_container', {image_speed: 600, menu_speed: 600} // attach custom event and disable autocalculation new EMenu('id_of_container', {onMenuShow: yourFunction, onMenuHide: yourOtherFunction, autocalc: false} function yourFunction(el) { // do something cool // note: this function receives the LI element that is moused over }
Enjoy!
