Anyone know of a decent way of making drupal menus exapandable when the user hovers over the parent menu item.
A:
Some themes come with expandable menus. Any theme based on the fusion ( http://drupal.org/project/fusion ) or adaptive theme ( http://drupal.org/project/adaptivetheme ) will give you expandable drop down menus. Check out the links to see which themes are based on the above themes.
To enable a dropdown just make sure that the menu item is market as "expanded".
No need to install any additional module or mess around with the theme code. Easy.
Sid NoParrots
2010-10-17 20:13:09
Yeah I can set it as expanded but that's then static - I want it to expand when the user hovers... Ideally a nice jquery so it slides down?
Shane
2010-10-18 11:27:23
That's why you should use something like the aqua marina theme ( http://drupal.org/project/acquia_marina ). Its a fusion based theme ( http://drupal.org/project/fusion ) that supports jQuery slide down menus "out of the box"
Sid NoParrots
2010-10-18 12:08:16
Well the site is built now - so that's not a solution for me, I'm currently writing some jquery to do this and I'll post it once I've done.
Shane
2010-10-18 14:45:51
Why write your own jQuery? You can use http://drupal.org/project/superfish
Sid NoParrots
2010-10-18 15:23:40
Becuase nobody mentioned that before!
Shane
2010-10-18 19:39:49
A:
Hi Everyone,
Wrote this bit of jquery which did the trick;
<style>
ul.menu li.expanded ul.menu { display:none;}
ul.menu li.active-trail ul.menu{ display:block;}
</style>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script>
$("li.expanded").mouseenter(function(){
$("li.expanded").each( function() {
$(this).find("ul.menu").css('display','none');
});
$(this).find("ul.menu").css('display','block');
$(this).animate( {'height':'100%'},1500);
});
</script>
Shane
2010-10-18 19:42:22