ConcordeMenu 2.1

Generate cool Context Menues with JavaScript



Details

Author
Hadrian Manolov
Current version
2.1
GitHub
enlogger/ConcordeMenu
Downloads
2186
Category
Interface
Tags
Report
GitHub Issues

Releases


Dependencies

  • core/1.2.4: *

How to use

Include the ConcordeMenu script and the Mootools-Core:

Initialize the Class and use the options for detailed configuration.

window.addEvent('domready', function() {

    var menu = new ConcordeMenu('concordemenu',document, {

        onItemSelect: function (item_id, element, origin) { 

            if (console.info) 
                console.info ("Menu Action -> Item ID: \"%s\" From: %o in %o", item_id, element, origin);        

        },

        onOpen: function(e) {  //console.log(e);

            e.target.get('tag') == 'a' ?
                this.enableItems(['menu_link_show','menu_link_open']) : 
                this.enableItems(['menu_link_show','menu_link_open'], false); 
        }

    });

    //menu.enableItems('menu_item_disabled',false); 

});

Concorde HTML Code:

Concorde Events:

onOpen, onClose, onItemSelect

Able options / default setting:

    observe_disabled_items: false,   //call onItemSelect() on disabled items?
    rightclick_to_open: true,        //open menu on rightclick (if browser supports contextmenu-events)
    crtl_switch: true,               //allow to switch between default browser menu and CM
    shift_with_contentmenu: true,    //default menu and CM combined together (not ie)
    fade_in: true,
    cursorx: 2,                      //distance to cursors-coords
    cursory: 1,
    opacity: 1                       //menu transparency (use carefully)

Look in the samples.html file for more samples.


Features

  • CSS Themes
  • Submenues
  • Hotkey-Shifts
  • Disable/enable Menues
  • Fade-In

Enable And Disable Items

Use enableThisItemsOnly and enableItems to enable or disable menu items by they're ids

enableThisItemsOnly ([item1,item2], true)       -> disable all other
enableThisItemsOnly (item)                      -> same
enableThisItemsOnly ([item1,item2], false)      -> enable all other

enableItems ([item1,item2])                     -> enable this items
enableItems (item1)                             -> same 
enableItems ([item1,item2], false)              -> disable this thems
enableItems ()                                  -> enable all items    
enableItems (false)                             -> disable all      

Arbitrary Section

Tested on the Windows-Versions of Firefox 3, Internet Explorer 8, Chrome, Safari and Opera. On Mac OS X: Firefox and Safari

Demo: http://webhike.de/labs/ConcordeMenu/samples.html

Blog Entry: http://enlogger.com/2009/11/concorde-menu/


Discuss

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