arnaucube
arnaucube/class2contextPublic Self-hosted repository
class2context/README.md
README.mdRaw
 1# class2context
 2javascript library, to add context menu functionallity to html page
 3
 4Demo: http://arnaucode.com/demos/class2context
 5
 6Referenced in: http://www.cssscript.com/lightweight-context-menu-library-class2context-js/
 7
 8![Alt text](https://raw.githubusercontent.com/arnaucode/class2context/master/class2context_01.gif "downlad and open the demo to test it")
 9
10### Installation
11```
12    bower install class2context --save
13```
14
15### Usage
16First, include the files
17```html
18<link rel='StyleSheet' type='text/css' href='class2context.css'>
19<script src='class2context.js'></script>
20```
21
22Then, for each class, call the function
23```js
24class2context('className', "title for contextmenu", [["option 1", "function1()"], ["option 2","function2()"]]);
25```
26Another example:
27```js
28array=[
29  ["<img src='1.png'> Menu 1", "function1()"],
30  ["<img src='2.png'> Menu 2", "function2()"],
31  ["<img src='3.png'> Menu 3", "function3()"],
32];
33class2context('demoClass', "Menu Title Here", array);
34```