
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
ui-contextmenu
Advanced tools
A jQuery plugin that provides a context menu (based on the standard jQueryUI menu widget).
<ul>
element or definition list (i.e.
[{title: "Paste", cmd: "paste"}, ...]
).The latest release is available at npm Registry:
$ npm install ui-contextmenu
See also the Change Log.
See also the unit tests and live examples
More:
First, include dependencies:
<head>
<link href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css" rel="stylesheet" />
<script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script>
<script src="assets/jquery.ui-contextmenu.min.js"></script>
Assume we have some HTML elements that we want to attach a popup menu to:
<div id="container">
<div class="hasmenu">AAA</div>
<div class="hasmenu">BBB</div>
<div class="hasmenu">CCC</div>
</div>
Now we can enable a context menu like so:
$("#container").contextmenu({
delegate: ".hasmenu",
menu: [
{title: "Copy", cmd: "copy", uiIcon: "ui-icon-copy"},
{title: "----"},
{title: "More", children: [
{title: "Sub 1", cmd: "sub1"},
{title: "Sub 2", cmd: "sub1"}
]}
],
select: function(event, ui) {
alert("select " + ui.cmd + " on " + ui.target.text());
}
});
Alternatively we can initialize the menu from embedded <ul> markup.
For more information:
Thanks to all contributors.
1.17.0 / 2017-04-17
disabled
, title
, and tooltip
optionsautoFocus
skips leading disabled entries.closeOnWindowBlur
.on()
/ .off()
syntax.delegate
optionFAQs
Turn a jQuery UI Menu widget into a contextmenu.
The npm package ui-contextmenu receives a total of 583 weekly downloads. As such, ui-contextmenu popularity was classified as not popular.
We found that ui-contextmenu demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.