MooTools ContextMenu Class by David Walsh
Posted on | January 29, 2009 | No Comments
Do you need to write some custom code or plug-in together for a context menu? I’m talking about the menu that comes up when you use your right mouse click. Well, now you don’t because David Walsh has release a pretty wicked and flexible ContextMenu class for MooTools.
It’s simple because it’ll create something like:
1 2 3 4 5 6 7 8 | <ul id="contextmenu"> <li><a href="#edit" class="edit">Edit</a></li> <li class="separator"><a href="#cut" class="cut">Cut</a></li> <li><a href="#copy" class="copy">Copy</a></li> <li><a href="#paste" class="paste">Paste</a></li> <li><a href="#delete" class="delete">Delete</a></li> <li class="separator"><a href="#quit" class="quit">Quit</a></li> </ul> |
And display the following with a right click:

I really like that you can enable/disable the menu or individual items in the menu. Something I’m looking forward to in his next version is to be able to add/remove items.
Head on over to his post for more info, the files, and a demo.
Comments
Leave a Reply