This is a simple yet powerful drop menu class. You can create an unlimited nested menu, build by the HTML tags ul and li. You can define your functions to open and close the menus with the onOpen and onClose Events. This gives you great power in customizing your drop down menu. You can customize the menu even more by CSS.
Just include MooDropMenu.js or MooDropMenu-min.js and the MooDropMenu.css to your HTML:
<script type="text/javascript" src="/js/MooDropMenu-min.js"></script> <link href="/css/MooDropMenu.css" rel="stylesheet" type="text/css" media="screen" />
And the menu structure
<ul id="nav">
<li><a href="#">Home</a></li>
<li>
<a href="#">Blog</a>
<ul>
<li><a href="#">Archive</a></li>
<li>
<a href="#">Categories</a>
<ul>
<li><a href="#">Javascript</a></li>
<li><a href="#">Mootools</a></li>
<li><a href="#">PHP</a></li>
</ul>
</li>
<li><a href="#">Last comment</a></li>
</ul>
</li>
<li><a href="#">Contact</a></li>
</ul>
And then initialize the menu
window.addEvent('domready',function(){
// The simple way
$('nav').MooDropMenu();
// The more advanced way
$('nav').MooDropMenu({
onOpen: function(el){
el.fade('in')
},
onClose: function(el){
el.fade('out');
},
onInitialize: function(el){
el.fade('hide').set('tween',{duration:1000});
}
});
// Using the MooDropMenuClass
var dropMenu = new MooDropMenu($('nav'),{
onOpen: function(el){
el.fade('in')
},
onClose: function(el){
el.fade('out');
},
onInitialize: function(el){
el.fade('hide').set('tween',{duration:1000});
}
});
}
var dropMenu = new MooDropMenu(element, [options]);
$('myElement').MooDropMenu([options]);
MIT-style license.
A note on comments here: These comments are moderated. No comments will show up until they are approved. Comments that are not productive (i.e. inflammatory, rude, etc) will not be approved.
Found a bug in this plugin? Please report it this repository's Github Issues.
blog comments powered by Disqus