Elegant Menu Mootools Plugin
April 4th, 2008 in scripts | 7 Comments
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. This plugin has been updated to work with Mootools 1.2.
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!

Hi, I'm Chris, a passionate freelance web developer. My languages of choice are PHP and JavaScript, and that's what you'll mostly find in my blog. You'll also find updates about 