arnaucode cbc1a7d10c | 7 years ago | |
---|---|---|
demo | 7 years ago | |
LICENSE | 8 years ago | |
README.md | 7 years ago | |
bower.json | 7 years ago | |
class2context.css | 8 years ago | |
class2context.js | 8 years ago | |
class2context_01.gif | 7 years ago | |
class2context_02.gif | 7 years ago | |
demoScreen.png | 8 years ago |
javascript library, to add context menu functionallity to html page
Demo: http://arnaucode.com/demos/class2context
Referenced in: http://www.cssscript.com/lightweight-context-menu-library-class2context-js/
bower install class2context --save
First, include the files
<link rel='StyleSheet' type='text/css' href='class2context.css'>
<script src='class2context.js'></script>
Then, for each class, call the function
class2context('className', "title for contextmenu", [["option 1", "function1()"], ["option 2","function2()"]]);
Another example:
array=[
["<img src='1.png'> Menu 1", "function1()"],
["<img src='2.png'> Menu 2", "function2()"],
["<img src='3.png'> Menu 3", "function3()"],
];
class2context('demoClass', "Menu Title Here", array);