nestable_list.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>H+ 后台主题UI框架 - 嵌套列表</title>
  7. <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
  8. <meta name="description" content="H+是一个完全响应式,基于Bootstrap3最新版本开发的扁平化主题,她采用了主流的左右两栏式布局,使用了Html5+CSS3等现代技术">
  9. <link rel="shortcut icon" href="favicon.ico"> <link href="css/bootstrap.min.css?v=3.3.7" rel="stylesheet">
  10. <link href="css/font-awesome.css?v=4.4.0" rel="stylesheet">
  11. <link href="css/animate.css" rel="stylesheet">
  12. <link href="css/style.css?v=4.1.0" rel="stylesheet">
  13. </head>
  14. <body class="gray-bg">
  15. <div class="wrapper wrapper-content animated fadeInRight">
  16. <div class="row">
  17. <div class="col-sm-4">
  18. <div id="nestable-menu">
  19. <button type="button" data-action="expand-all" class="btn btn-white btn-sm">展开所有</button>
  20. <button type="button" data-action="collapse-all" class="btn btn-white btn-sm">收起所有</button>
  21. </div>
  22. </div>
  23. </div>
  24. <div class="row">
  25. <div class="col-sm-6">
  26. <div class="ibox ">
  27. <div class="ibox-title">
  28. <h5>基本嵌套列表</h5>
  29. </div>
  30. <div class="ibox-content">
  31. <p class="m-b-lg">
  32. <strong>Nestable</strong> 支持拖动排序和触摸屏。
  33. </p>
  34. <div class="dd" id="nestable">
  35. <ol class="dd-list">
  36. <li class="dd-item" data-id="1">
  37. <div class="dd-handle">1 - 列表</div>
  38. </li>
  39. <li class="dd-item" data-id="2">
  40. <div class="dd-handle">2 - 列表</div>
  41. <ol class="dd-list">
  42. <li class="dd-item" data-id="3">
  43. <div class="dd-handle">3 - 列表</div>
  44. </li>
  45. <li class="dd-item" data-id="4">
  46. <div class="dd-handle">4 - 列表</div>
  47. </li>
  48. </ol>
  49. </li>
  50. <li class="dd-item" data-id="5">
  51. <div class="dd-handle">5 - 列表</div>
  52. <ol class="dd-list">
  53. <li class="dd-item" data-id="6">
  54. <div class="dd-handle">6 - 列表</div>
  55. </li>
  56. <li class="dd-item" data-id="7">
  57. <div class="dd-handle">7 - 列表</div>
  58. </li>
  59. </ol>
  60. </li>
  61. <li class="dd-item" data-id="8">
  62. <div class="dd-handle">8 - 列表</div>
  63. </li>
  64. <li class="dd-item" data-id="9">
  65. <div class="dd-handle">9 - 列表</div>
  66. </li>
  67. </ol>
  68. </div>
  69. <div class="m-t-md">
  70. <h5>数据:</h5>
  71. </div>
  72. <textarea id="nestable-output" class="form-control"></textarea>
  73. </div>
  74. </div>
  75. </div>
  76. <div class="col-sm-6">
  77. <div class="ibox ">
  78. <div class="ibox-title">
  79. <h5>自定义主题</h5>
  80. </div>
  81. <div class="ibox-content">
  82. <p class="m-b-lg">
  83. 每个列表可以自定义标准的CSS样式。每个单元响应所以你可以给它添加其他元素来改善功能列表。
  84. </p>
  85. <div class="dd" id="nestable2">
  86. <ol class="dd-list">
  87. <li class="dd-item" data-id="1">
  88. <div class="dd-handle">
  89. <span class="label label-info"><i class="fa fa-users"></i></span> 群组
  90. </div>
  91. <ol class="dd-list">
  92. <li class="dd-item" data-id="2">
  93. <div class="dd-handle">
  94. <span class="pull-right"> 12:00 </span>
  95. <span class="label label-info"><i class="fa fa-cog"></i></span> 设置
  96. </div>
  97. </li>
  98. <li class="dd-item" data-id="3">
  99. <div class="dd-handle">
  100. <span class="pull-right"> 11:00 </span>
  101. <span class="label label-info"><i class="fa fa-bolt"></i></span> 筛选
  102. </div>
  103. </li>
  104. <li class="dd-item" data-id="4">
  105. <div class="dd-handle">
  106. <span class="pull-right"> 11:00 </span>
  107. <span class="label label-info"><i class="fa fa-laptop"></i></span> 电脑
  108. </div>
  109. </li>
  110. </ol>
  111. </li>
  112. <li class="dd-item" data-id="5">
  113. <div class="dd-handle">
  114. <span class="label label-warning"><i class="fa fa-users"></i></span> 用户
  115. </div>
  116. <ol class="dd-list">
  117. <li class="dd-item" data-id="6">
  118. <div class="dd-handle">
  119. <span class="pull-right"> 15:00 </span>
  120. <span class="label label-warning"><i class="fa fa-users"></i></span> 列用户表
  121. </div>
  122. </li>
  123. <li class="dd-item" data-id="7">
  124. <div class="dd-handle">
  125. <span class="pull-right"> 16:00 </span>
  126. <span class="label label-warning"><i class="fa fa-bomb"></i></span> 炸弹
  127. </div>
  128. </li>
  129. <li class="dd-item" data-id="8">
  130. <div class="dd-handle">
  131. <span class="pull-right"> 21:00 </span>
  132. <span class="label label-warning"><i class="fa fa-child"></i></span> 子元素
  133. </div>
  134. </li>
  135. </ol>
  136. </li>
  137. </ol>
  138. </div>
  139. <div class="m-t-md">
  140. <h5>数据:</h5>
  141. </div>
  142. <textarea id="nestable2-output" class="form-control"></textarea>
  143. </div>
  144. </div>
  145. </div>
  146. </div>
  147. </div>
  148. <!-- 全局js -->
  149. <script src="js/jquery.min.js?v=2.1.4"></script>
  150. <script src="js/bootstrap.min.js?v=3.3.7"></script>
  151. <!-- 自定义js -->
  152. <script src="js/content.js?v=1.0.0"></script>
  153. <!-- Nestable List -->
  154. <script src="js/plugins/nestable/jquery.nestable.js"></script>
  155. <script>
  156. $(document).ready(function () {
  157. var updateOutput = function (e) {
  158. var list = e.length ? e : $(e.target),
  159. output = list.data('output');
  160. if (window.JSON) {
  161. output.val(window.JSON.stringify(list.nestable('serialize'))); //, null, 2));
  162. } else {
  163. output.val('浏览器不支持');
  164. }
  165. };
  166. // activate Nestable for list 1
  167. $('#nestable').nestable({
  168. group: 1
  169. }).on('change', updateOutput);
  170. // activate Nestable for list 2
  171. $('#nestable2').nestable({
  172. group: 1
  173. }).on('change', updateOutput);
  174. // output initial serialised data
  175. updateOutput($('#nestable').data('output', $('#nestable-output')));
  176. updateOutput($('#nestable2').data('output', $('#nestable2-output')));
  177. $('#nestable-menu').on('click', function (e) {
  178. var target = $(e.target),
  179. action = target.data('action');
  180. if (action === 'expand-all') {
  181. $('.dd').nestable('expandAll');
  182. }
  183. if (action === 'collapse-all') {
  184. $('.dd').nestable('collapseAll');
  185. }
  186. });
  187. });
  188. </script>
  189. <script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
  190. <!--统计代码,可删除-->
  191. </body>
  192. </html>