SooperFish is a highly configurable solution for animated dropdown menus. It combines the features of superfish, structured programming of Droppy and a ton of new features like multi-column dropdown menus and configurable show AND hide animation with custom easing.
It was originally created to power the drop-down menus for the premium drupal themes on this site and now it's avaiable to anyone.
{syntaxhighlighter brush: jscript}
$(document).ready(function() {
$('ul.sf-menu').sooperfish({
dualColumn : 6, //if a submenu has at least this many items it will be divided in 2 columns
tripleColumn : 8, //if a submenu has at least this many items it will be divided in 3 columns
hoverClass : 'sfHover',
delay : 500, //make sure menus only disappear when intended, 500ms is advised by Jacob Nielsen
animationShow : {width:'show',height:'show',opacity:'show'},
speedShow : 750,
easingShow : 'easeOutBounce',
animationHide : {width:'hide',height:'hide',opacity:'hide'},
speedHide : 300,
easingHide : 'easeInOvershoot',
autoArrows : true
});
});
{/syntaxhighlighter}
Work in Progress
If you spot a bug or want a feature, feel free to drop a comment or file an issue at the jQuery plugin page
From previous blog posts I've learned that multi column / animated dopdown menus are really in demand. I've now pretty much completed a new jQuery plugin that handles all this. At first I started modifying superfish but I had learned that superfish uses some really funky events bindings and event handling which caused the submenu-hide animations to fail on sub-sub menus, and there were some other weird bugs.
So I spent the whole day coding a new plugin based on the much leaner jQuery droppy plugin and had a much better time working up from there! So now I thought why stop now, maybe someone can think of some cool features that I haven't yet implemented.
Here is an overview of the options it currently takes:
As you can see it also uses custom easing!
If you can think of any cool behaviours that can be added to this plugin don't hesitate to drop a comment!
And no, it does not magically allow you to create true mega-dropdown menus with blocks and grouped menus and all. Unfortunately I lack the skills and understanding to create a decent module that somehow combines Drupals otherwise awesome menu system with blocks and views
.
Though if you are interested in this have a look here: http://drupal.org/node/778452 http://drupal.org/project/megamenu
Some advantages of this jQuery plugin (compared with superfish):
Automatic multicolumns submenus
Full configurable animations
Custom easing support
menu-Hide animation
Dropped hoverIntent plugin in favor of simple setTimeOut on mouseOut.
Optional automatic submenu indicator arrows available in black and white
All new CSS, more compact and easy to skin
Readable, documented and well organised jQuery code. Though I must admit I'm not a top notch programmer and the code is very verbose, but if you're a beginner you'll love it.
I'm working on a new framework for dropdown menus and I'm running out of ideas. So far I got:
Animation on showing as well as hiding the menu (superfish only supports on-show)
Automatic configurable multi-column dropdowns. When number of items in a submenu exceeds set number a submenu is 2 columns, or 3 columns. (will look like http://www.whitehouse.gov)
Added support for custom easing, including the additional easing from the jQuery easing plugin and some homebrew easing*.
Animated properties are configurable (widh/height/opacity)
So what cool menu feature would you like to have on your next Drupal site? drop your idea in the comments!
*my new and favorite dropdown easing:
easeInOvershootTurbo: function (x, t, b, c, d, s) {
if (s == undefined) s = 1.70158;
return c*(t/=d)*t*t*((s+1)*t - s) + b;
},
easeOutOvershootTurbo: function (x, t, b, c, d, s) {
if (s == undefined) s = 1.70158;
return c*((t=t/d-1)*t*t*((s+1)*t + s) + 1) + b;
}