speed-dial.html 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <title>九宫格</title>
  2. <div class="layui-card layadmin-header">
  3. <div class="layui-breadcrumb" lay-filter="breadcrumb">
  4. <a lay-href="">主页</a>
  5. <a><cite>组件</cite></a>
  6. <a><cite>栅格</cite></a>
  7. <a><cite>九宫格</cite></a>
  8. </div>
  9. </div>
  10. <style>
  11. /* 这段样式只是用于演示 */
  12. #LAY-component-grid-speed-dial .layui-card-body{display: flex; justify-content: center; flex-direction: column; text-align: center; font-size: 20px;}
  13. #LAY-component-grid-speed-dial .layui-card-body:hover{background-color: #FAFAFA;}
  14. </style>
  15. <div class="layui-fluid" id="LAY-component-grid-speed-dial">
  16. <div class="layui-row layui-col-space1">
  17. <div class="layui-col-xs4">
  18. <!-- 填充内容 -->
  19. <div class="layui-card">
  20. <div class="layui-card-body">1</div>
  21. </div>
  22. </div>
  23. <div class="layui-col-xs4">
  24. <div class="layui-card">
  25. <div class="layui-card-body">2</div>
  26. </div>
  27. </div>
  28. <div class="layui-col-xs4">
  29. <div class="layui-card">
  30. <div class="layui-card-body">3</div>
  31. </div>
  32. </div>
  33. <div class="layui-col-xs4">
  34. <div class="layui-card">
  35. <div class="layui-card-body">4</div>
  36. </div>
  37. </div>
  38. <div class="layui-col-xs4">
  39. <div class="layui-card">
  40. <div class="layui-card-body">5</div>
  41. </div>
  42. </div>
  43. <div class="layui-col-xs4">
  44. <div class="layui-card">
  45. <div class="layui-card-body">6</div>
  46. </div>
  47. </div>
  48. <div class="layui-col-xs4">
  49. <div class="layui-card">
  50. <div class="layui-card-body">7</div>
  51. </div>
  52. </div>
  53. <div class="layui-col-xs4">
  54. <div class="layui-card">
  55. <div class="layui-card-body">8</div>
  56. </div>
  57. </div>
  58. <div class="layui-col-xs4">
  59. <div class="layui-card">
  60. <div class="layui-card-body">9</div>
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. <script>
  66. layui.use(['admin'], function(){
  67. var $ = layui.$
  68. ,admin = layui.admin
  69. ,element = layui.element;
  70. element.render('breadcrumb', 'breadcrumb');
  71. //监听窗口尺寸改变事件,控制宽度相同
  72. admin.resize(function(){
  73. var cardBody = $('#LAY-component-grid-speed-dial .layui-card-body');
  74. cardBody.height(cardBody.width())
  75. });
  76. });
  77. </script>