Fork me on GitHub

jQuery contextMenu

Demo: Importing HTML5 <menu type="context">

jQuery.contextMenu allows you to import HTML5's <menu> structures to use in older browsers.

Example Code: Importing HTML5 <menu type="context">


$(function(){
    $.contextMenu({
        selector: '.context-menu-html5menu', 
        items: $.contextMenu.fromMenu($('#html5menu'))
    });
});
    

Example HTML: Importing HTML5 <menu type="context">

<div class="context-menu-html5menu box menu-1">
    <strong>right click me</strong>
</div>
<menu id="html5menu" type="context" style="display:none" class="showcase">
  <command label="rotate" onclick="alert('rotate')"></command>
  <command label="resize" onclick="alert('resize')"></command>
  <menu label="share">
    <command label="twitter" onclick="alert('twitter')"></command>
    <hr>
    <command label="facebook" onclick="alert('facebook')"></command>
  </menu>
</menu>

jQuery Context Menu Demo Gallery