You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
978 B

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