Lightweight Context Menu Library – class2context.js

Category: Javascript , Menu & Navigation | July 18, 2016
Views Total:2,226 views
Official Page:Go to website
Last Update:July 18, 2016


Lightweight Context Menu Library – class2context.js


class2context.js is a lightweight, simple-to-use JavaScript plugin that helps you add a custom context menu to your webpage.

How to use it:

Include the following files into your webpage.

<link rel='stylesheet' href='class2context.css'>
<script src='class2context.js'></script>

Create an array of menu items with custom icons and functions when clicked.

  ["<img src='1.png'> Menu 1", "function1()"], 
  ["<img src='2.png'> Menu 2", "function2()"],
  ["<img src='3.png'> Menu 3", "function3()"],

Append the context menu to a specified container like ‘demo’.

class2context('demo', "Menu Title Here", array);

You Might Be Interested In:

Leave a Reply