Context menus - made easy for the web!
Download Follow @candh Star ForkUsers are used to open a context menu whenever they want more options. If you're making a fully immersive web app, then people would hope to see a context menu with some options whenever they right click on an object. This plugin provides an easy way to define context menus for your web app so your users can have the best experience.
Using rightClick is incredibly easy. Just follow these easy steps
<!-- plugin styles -->
<link rel="stylesheet" type="text/css" href="/rightclick.css">
<!-- script files -->
<script src="/jquery.min.js" type="text/javascript"></script>
<script src="/rightclick.js" type="text/javascript"></script>
Remember to give your menu a class of .menu
for all the cool styles to apply! Also give it a id
so we can hook it up with its listener later
<div id="ctx-menu-1" class="menu">
<ul>
<li>Stop</li>
<li>Play</li>
<li class="disabled">Cocoa</li>
<li>Butter</li>
<li>Kisses</li>
<li>Very long menu item</li>
<li>Sub Menu
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>Very long menu item</li>
</ul>
</li>
</ul>
</div>
$('#target1').rightClick('#ctx-menu-1');
Right click on these two divs to see rightClick.js in action!