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.

194 lines
7.2 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
  5. <meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1'>
  6. <title>demo class2context.js</title>
  7. <!-- Bootstrap -->
  8. <!-- Latest compiled and minified CSS -->
  9. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
  10. <link rel="shortcut icon" href="class2context.png">
  11. <link rel='StyleSheet' type='text/css' href='class2context.css'>
  12. <link href='http://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>
  13. <style>
  14. body{
  15. font-family: 'Roboto', sans-serif;
  16. /*font-size: 48px;*/
  17. }
  18. .box1{
  19. width: 200px;
  20. height: 300px;
  21. margin: 15px;
  22. display: inline-block;
  23. /*border: 2px solid #000000;*/
  24. border-radius: 5px;
  25. text-align: left;
  26. vertical-align: middle;
  27. padding: 20px;
  28. }
  29. .box1:hover{
  30. box-shadow: 0 5px 10px #BEF7F2;
  31. }
  32. .box2{
  33. width: 600px;
  34. min-height: 300px;
  35. margin: 15px;
  36. margin-left:auto;
  37. margin-right: auto;
  38. display: block;
  39. border-radius: 5px;
  40. text-align: left;
  41. vertical-align: middle;
  42. padding: 20px;
  43. }
  44. .box3{
  45. width: 600px;
  46. margin: 15px;
  47. margin-left:auto;
  48. margin-right: auto;
  49. display: block;
  50. border-radius: 5px;
  51. text-align: left;
  52. vertical-align: middle;
  53. padding: 20px;
  54. }
  55. .centralBox{
  56. text-align: center;
  57. width: 100%;
  58. margin: 0 auto;
  59. }
  60. .codeFont{
  61. color: #DAE8E8;
  62. }
  63. .heightMainBox{
  64. height: 200px;
  65. }
  66. .mainimg{
  67. width: 100px;
  68. display: inline-block;
  69. transition: all .5s;
  70. top:0;
  71. vertical-align:top;
  72. }
  73. .mainimg:hover{
  74. width:150px;
  75. transition: all .2s;
  76. }
  77. </style>
  78. </head>
  79. <body onload="">
  80. <div class='container'>
  81. <div class="classHeader centralBox">
  82. <h1><img src='class2context.png' width='100px' />class2context.js</div>
  83. </div>
  84. <br><br>
  85. <div class='centralBox heightMainBox'>
  86. <a href="#" data-toggle="tooltip" data-placement="bottom" title="Configurable!">
  87. <img src='http://image.flaticon.com/icons/svg/167/167516.svg' class='mainimg' />
  88. </a>
  89. <a href="#" data-toggle="tooltip" data-placement="bottom" title="High performance!">
  90. <img src='http://image.flaticon.com/icons/svg/167/167479.svg' class='mainimg' />
  91. </a>
  92. <a href="#" data-toggle="tooltip" data-placement="bottom" title="Permits increment functionallities!">
  93. <img src='http://image.flaticon.com/icons/svg/167/167486.svg' class='mainimg' />
  94. </a>
  95. <a href="#" data-toggle="tooltip" data-placement="bottom" title="Multiple platform!">
  96. <img src='http://image.flaticon.com/icons/svg/167/167488.svg' class='mainimg' />
  97. </a>
  98. </div>
  99. <div class='centralBox'>
  100. <div class='class1 box3' style='background: #769ba3;' >
  101. - github: <a href="https://github.com/arnaucode/class2context" target="_blank">- Github repo</a><br>
  102. - install: 'bower install class2context --save'<br>
  103. - referenced in: <a href="http://www.cssscript.com/lightweight-context-menu-library-class2context-js/" target="_blank">http://www.cssscript.com/lightweight-context-menu-library-class2context-js/</a>
  104. </div>
  105. <div class='class1 box1' style='background: #0FA3B1;'>
  106. <h4>A</h4>
  107. This is a demo
  108. <br>
  109. Just need to include the files:
  110. <ul>
  111. <li>class2context.js</li>
  112. <li>class2context.css</li>
  113. </ul>
  114. </div>
  115. <div class='class2 box1' style='background: #FF9B42;'>
  116. <h4>Get started!</h4>
  117. Right click over me!
  118. <div class='classSub2 box1' style='background: #5797CC; width: 130px; height: 180px!important;'>
  119. element inside element with diferent class
  120. </div>
  121. </div>
  122. <div class='class3 box1' style='background: #8BC34A;'>
  123. <h4>Use</h4>
  124. when html is charged, call the function
  125. </div>
  126. <div class='class4 box2' style='background: #9375A3;'>
  127. <h4>Usage</h4>
  128. when html is charged, call the function:<br>
  129. <div class='codeFont'>
  130. <b>class2context</b>(
  131. <br> 'className',
  132. <br> "title",
  133. <br> [["option1", "functionoption1()"], ["option 2","functionoption2()"]]
  134. <br>);
  135. </div>
  136. </div>
  137. </div>
  138. </div>
  139. <br><br><br><br>
  140. <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
  141. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
  142. <!-- Include all compiled plugins (below), or include individual files as needed -->
  143. <!-- Latest compiled and minified JavaScript -->
  144. <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
  145. <script src='class2context.js'></script>
  146. <script>
  147. array=[["<img src='http://icons.iconarchive.com/icons/designbolts/free-multimedia/1024/iMac-icon.png' width='25px' /> A1", "function1()"], ["<img src='http://icons.iconarchive.com/icons/dakirby309/simply-styled/32/Autodesk-Alias-Design-icon.png' width='25px' /> A2","function2()"]];
  148. class2context('class1', "titleA", array);
  149. class2context('class3', "titleC", [["<img src='http://icons.iconarchive.com/icons/iynque/flurry-extras-8/32/123D-Design-icon.png' width='25px' /> C1", "function1()"], ["<img src='http://icons.iconarchive.com/icons/oxygen-icons.org/oxygen/32/Actions-draw-brush-icon.png' width='25px' /> C3","function3()"]]);
  150. class2context('class2', "titleB", [["<img src='http://icons.iconarchive.com/icons/custom-icon-design/flatastic-6/32/3d-material-drop-tool-icon.png' width='25px' /> B2", "function2()"], ["<img src='http://icons.iconarchive.com/icons/iynque/ios7-style/32/Design-Briefs-icon.png' width='25px' /> B3","function3()"]]);
  151. class2context("classHeader", "titleTableMenu", [["header function 1", "function1()"], ["header function 2", "function2()"]]);
  152. class2context('class4',"title",[["option1", "function1()"], ["option 2","function2()"]]);
  153. class2context('mainimg', "Image context menu", [["<img src='http://icons.iconarchive.com/icons/iynque/flurry-extras-8/32/123D-Design-icon.png' width='25px' /> C1", "function1()"], ["<img src='http://icons.iconarchive.com/icons/oxygen-icons.org/oxygen/32/Actions-draw-brush-icon.png' width='25px' /> C3","function3()"]]);
  154. class2context('classSub2', "sub element context inside other element", [["<img src='http://icons.iconarchive.com/icons/iynque/flurry-extras-8/32/123D-Design-icon.png' width='25px' /> C1", "function1()"]]);
  155. function function1(){
  156. alert("function 1 clicked");
  157. }
  158. function function2(){
  159. alert("function 2 clicked");
  160. }
  161. function function3(){
  162. alert("function 3 clicked");
  163. }
  164. function ContextMenus(){
  165. console.log("context menu called");
  166. }
  167. $(document).ready(function(){
  168. $('[data-toggle="tooltip"]').tooltip();
  169. });
  170. </script>
  171. </body>
  172. </html>