Web Component: j-ContextMenu
j-ContextMenu
easy usage for different cases
supports 3 orientations
left
,center
andright
singleton
works with Bootstrap Grid System
works with touches
jComponent
v19|v20
Methods:
Method: component.show(orientation, targetElement, [items], clickCallback, [offsetX], [offsetY])
orientation
{String}
can beleft
,center
orright
targetElement
{Selector/jQuery/Element}
a target where the component will be visibleitems {Array}
optional and must have this structure:[{ name: String, value: String, icon: String }]
otherwise will be items read from the target'sdata-options
attribute.callback(selectedValue)
{Function}
is triggered when the user clicks on the itemoffsetX
{Number}
optional can change offset XoffsetY
{Number}
optional can change offset Y
Method: component.hide()
Attributes:
targetElement
can contain data-options="Name 1|fa-building|Value 1;Name 2|fa-github|Value 2;"
attribut with all items of the context menu.
If the value
isn't defined then the component uses name
as value
.
Global events:
ON('contextmenu', function(visible, component, target) {
console.log('ContextMenu is', visible ? 'visible' : 'hidden');
});
Author
- Peter Širka petersirka@gmail.com
- License
Created
11. may 2016
Updated
25. january 2023
jComponent library
19 | 20
Version
v1
License
https://www.totaljs.com/license/
Responsive
No
Author
Peter Širka
Email
petersirka@gmail.com