Minimal Context Menu Plugin For jQuery / Bootstrap

File Size: 4.8 KB
Views Total: 1109
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
Minimal Context Menu Plugin For jQuery / Bootstrap

An extremely lightweight jQuery plugin that uses Bootstrap Dropdowns component to apply a right-click context menu to specified container.

How to use it:

1. Include the jQuery Bootstrap Contextmenu plugin in your Bootstrap project.

<script src="jquery-2.1.4.min.js"></script>
<link rel="stylesheet" href="bootstrap.min.css">
<script src="bootstrap.min.js"></script>

<script src="jquery.context.min.js"></script>

2. Create a Bootstrap dropdown menu for the context menu.

<ul class="dropdown-menu" id="demo">
  <li><a href="#">Action 1</a></li>
  <li><a href="#">Action 2</a></li>
  <li><a href="#">Action 3</a></li>
</ul>

3. Initialize the plugin to enable the context menu '#demo' inside the container '#wrapper'.

$('#wrapper').contextmenu('#demo', function(clicked, selected) {

  // callback function
  
});

This awesome jQuery plugin is developed by jochemstoel. For more Advanced Usages, please check the demo page or visit the official website.