About of AntContextMenu

AntContextMenu, is the jQuery context menu plug-in of AntProduction. It is based on jQuery UI Menu. The context menu, AntContextMenu, appears on right mouse cleck event.


Have a question about AntContextMenu ? Please use GitHub Issue.

Documentation of AntContextMenu

Fields Description
disableClickEventItemWithSubMenu [boolean] Booleant to disable click event on Item with submenu
margin [json] margin is a json object that contains css margins of context menu. It's compounded by :
  • defaultMarginX: margins left and right
  • defaultMarginY: margins top and bottom
position [json] defined the offset to be applied to the mouse cursor coordinates to position the upper left corner of the context menu when opened.
  • defaultMenuPositionX: offset to be applied to X coordinate
  • defaultMenuPositionY: offset to be applied to Y coordinate
contextMenuSelector [string] The selector of the AntContextMenu

Samples of AntContextMenu

Basic sample of AntContextMenu. Try it

Tips of AntContextMenu

How to bind event on items of AntContextMenu ?

made as usual. for example:

    $(".ui-menu-item").bind(function() {...})

How to select item without sub menu ?

the selector is:

    $(".ui-menu-item[aria-haspopup!="true"]'")

How to select item with sub menu ?

the selector is:

    $(".ui-menu-item[aria-haspopup="true"]'")

How to disable an item ?

For exemple to disable 2nd item use :

    $('ul#menu>li:nth-child(2)').addClass('ui-state-disabled').off('click');