clickMenu update -> 0.1.2
Another update for the jQuery plugin. It’s got a LOT better (and if not, than at least faster!).
Please take a look at the demo.
Files: (new version here)
- jquery.clickmenu.js (13kb)
- jquery.clickmenu.pack.js (5kb)
- clickmenu.css (2kb - it won’t work without this)
Example:
<script type="text/javascript">
$(document).ready(function()
{
$.fn.clickMenu.setDefaults({arrowSrc:'arrow_right.gif', onClick: function(){/*do something*/}});
$('selector1').clickMenu(); /* use default values */
$('selector2').clickMenu({arrowSrc:''}); /* dont use an arrow for submenus */
$('selector3').clickMenu({fadeTime: 2000, subDelay: 1000, mainDelay: 500}); /* slow menu */
});
</script>
Available options:
- onClick - function - callback function triggered when a list item is clicked
- arrowSrc - string - url of the image to be used as an arrow indicating a submenu (e.g. “images/somearrow.jpg” or an empty string if you don’t want an arrow)
- mainDelay - string or number - the time to wait before starting the fadein after hovering over a main menu item (”slow”, “normal” or “fast” or the time in milliseconds - e.g. 1000)
- subDelay - string or number - the time to wait before starting the fadein after hovering submenu item (”slow”, “normal” or “fast” or the time in milliseconds - e.g. 1000)
- fadeTime - string or number - the speed at which the fadein/fadeout animation runs (”slow”, “normal” or “fast” or the time in milliseconds - e.g. 1000)
Changelog:
- change: made a lot changes in the traversing routines to speed things up (having better memory usage now as well)
- change: added $.fn.clickMenu.setDefaults() for setting global defaults
- fix: hoverbug when a main menu item had no submenu
- fix: some bugs i found while rewriting most of the stuff
- change: renamed file to jquery.clickmenu.js
Known problems:
- memory usage’s gotten better, but is still far from perfect
- the css-defined min-width is not working on ie, what may make the submenus really narrow



