PageRenderTime 50ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/src/resizable/demo.html

https://github.com/vincent1900/kissy
HTML | 135 lines | 123 code | 12 blank | 0 comment | 0 complexity | 1fc4145c1e8fb62c4703954489206efd MD5 | raw file
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8"/>
  5. <title>S.Resizable Demo</title>
  6. <style>
  7. .ke-resizehandler {
  8. overflow: hidden;
  9. font-size: 0;
  10. line-height: 0;
  11. position: absolute;
  12. }
  13. .ke-resizehandler-b {
  14. height: 5px;
  15. width: 100%;
  16. background-color: yellow;
  17. bottom: 0;
  18. left: 0;
  19. cursor: n-resize;
  20. }
  21. .ke-resizehandler-t {
  22. height: 5px;
  23. width: 100%;
  24. background-color: yellow;
  25. top: 0;
  26. left: 0;
  27. cursor: n-resize;
  28. }
  29. .ke-resizehandler-l {
  30. height: 100%;
  31. -height: expression(this.parentNode.offsetHeight);
  32. width: 5px;
  33. background-color: yellow;
  34. top: 0;
  35. left: 0;
  36. cursor: e-resize;
  37. }
  38. .ke-resizehandler-r {
  39. height: 100%;
  40. -height: expression(this.parentNode.offsetHeight);
  41. background-color: yellow;
  42. width: 5px;
  43. position: absolute;
  44. top: 0;
  45. right: 0;
  46. cursor: e-resize;
  47. }
  48. .ke-resizehandler-bl {
  49. height: 5px;
  50. width: 5px;
  51. background-color: green;
  52. z-index: 1;
  53. bottom: 0;
  54. left: 0;
  55. cursor: sw-resize;
  56. }
  57. .ke-resizehandler-br {
  58. height: 5px;
  59. width: 5px;
  60. z-index: 1;
  61. background-color: green;
  62. bottom: 0;
  63. right: 0;
  64. cursor: se-resize;
  65. }
  66. .ke-resizehandler-tl {
  67. height: 5px;
  68. width: 5px;
  69. z-index: 1;
  70. background-color: green;
  71. top: 0;
  72. left: 0;
  73. cursor: nw-resize;
  74. }
  75. .ke-resizehandler-tr {
  76. height: 5px;
  77. width: 5px;
  78. z-index: 1;
  79. background-color: green;
  80. top: 0;
  81. right: 0;
  82. cursor: ne-resize;
  83. }
  84. </style>
  85. </head>
  86. <body>
  87. 拖放测试
  88. <div style="border:1px solid red;width:200px;height:100px;overflow:hidden;" id="t">
  89. <button id="destroy" style='margin-top:50px;'>
  90. destroy resize
  91. </button>
  92. </div>
  93. <script src="../seed/kissy.js"></script>
  94. <script src="../seed/lang.js"></script>
  95. <script src="../seed/web.js"></script>
  96. <script src="../seed/loader.js"></script>
  97. <script src="../../build/ua.js"></script>
  98. <script src="../../build/node.js"></script>
  99. <script src="../../build/dom.js"></script>
  100. <script src="../../build/event.js"></script>
  101. <script src="../../build/base.js"></script>
  102. <script src="../../build/dd.js"></script>
  103. <script src="../../build/uibase.js"></script>
  104. <script src="base.js"></script>
  105. <script src="../resizable.js"></script>
  106. <script>
  107. KISSY.use("node,resizable", function(S, N, Resizable) {
  108. var Node = S.require("node/node");
  109. S.ready(function(S) {
  110. var r = new Resizable({
  111. node:"#t",
  112. minHeight:10,
  113. autoRender:true,
  114. handlers:["b","t","r","l","tr","tl","br","bl"]
  115. });
  116. Node.one("#destroy").on("click", function() {
  117. r.destroy();
  118. });
  119. });
  120. });
  121. </script>
  122. </body>
  123. </html>