JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://swisnl.github.io/jQuery-contextMenu/dist/jquery.contextMenu.min.js"></script>
<link rel="stylesheet" href="https://swisnl.github.io/jQuery-contextMenu/dist/jquery.contextMenu.min.css">
<!-- пример из сайта know-online.com -->
<div class="context-menu-one">нажать на правую кнопку мыши</div>
<div id="res"></div>
CSS
body {
padding: 5px;
font: 12px verdana;
}
.context-menu-one {
border: 1px solid #C2C2C2;
padding: 10px;
}
#res {
margin-top: 10px;
}
JavaScript
$.contextMenu({
selector: '.context-menu-one',
items: {
open: {name: 'Открыть', icon: 'open'},
save: {name: 'Сохранить', icon: 'save'},
sep1: '---------',
quit: {name: 'Выйти', icon: 'quit'}
},
callback: function(key, options) {
$('#res').html('Выбрана команда: <strong>' + key + '</strong>');
}
});