I am trying to late-bind context menus to elements, using the ContextMenu plugin. So on the first right-click on those elements, I would like to :
data('events').contextmenu
exists,I'm having trouble with the last item. jQuery allows to .click()
or to .trigger('click')
, which simulate a left-click, but there seems not to be a way to fire a right-click event through trigger
.
Or is there?
You can trigger it by
$('#element').trigger({
type: 'mousedown',
which: 3
});