theme.html 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <title>layer 组件风格定制</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 href="http://layer.layui.com/" target="_blank">layer</a>
  7. <a><cite>风格定制</cite></a>
  8. </div>
  9. </div>
  10. <style>
  11. /* 这段样式只是用于演示 */
  12. #LAY-component-layer-theme .layui-card-body{padding-top: 15px;}
  13. </style>
  14. <div class="layui-fluid" id="LAY-component-layer-theme">
  15. <div class="layui-row layui-col-space15">
  16. <div class="layui-col-md12">
  17. <div class="layui-card">
  18. <div class="layui-card-header">风格定制</div>
  19. <div class="layui-card-body">
  20. <div class="layui-btn-container layadmin-layer-demo">
  21. <button data-type="test1" class="layui-btn layui-btn-primary">layuiAdmin风格</button>
  22. <button data-type="test2" class="layui-btn layui-btn-primary">右侧呼出</button>
  23. </div>
  24. </div>
  25. </div>
  26. </div>
  27. <div class="layui-col-md12">
  28. <div class="layui-card">
  29. <div class="layui-card-body">
  30. 持续增加中
  31. </div>
  32. </div>
  33. </div>
  34. </div>
  35. </div>
  36. <script>
  37. layui.use(['admin'], function(){
  38. var $ = layui.$
  39. ,admin = layui.admin
  40. ,element = layui.element
  41. ,router = layui.router();
  42. element.render();
  43. var active = {
  44. test1: function(){
  45. admin.popup({
  46. title: 'layuiAdmin'
  47. ,shade: 0
  48. ,anim: -1
  49. ,area: ['280px', '150px']
  50. ,id: 'layadmin-layer-skin-test'
  51. ,skin: 'layui-anim layui-anim-upbit'
  52. ,content: '内容'
  53. })
  54. }
  55. ,test2: function(){
  56. admin.popupRight({
  57. id: 'LAY_adminPopupLayerTest'
  58. ,success: function(){
  59. $('#'+ this.id).html('<div style="padding: 20px;">放入内容</div>');
  60. //admin.view(this.id).render('system/xxx')
  61. }
  62. });
  63. }
  64. };
  65. $('#LAY-component-layer-theme .layadmin-layer-demo .layui-btn').on('click', function(){
  66. var type = $(this).data('type');
  67. active[type] && active[type].call(this);
  68. });
  69. });
  70. </script>