项目作者: io-developer

项目描述 :
Vanilla JS dom element resizing
高级语言: JavaScript
项目地址: git://github.com/io-developer/js-resizable.git
创建时间: 2014-08-04T10:12:31Z
项目社区:https://github.com/io-developer/js-resizable

开源协议:MIT License

下载


resizable

Pure JS resizing for any binded DOM element.
You can mixin behavior with lib js-dragndrop

Example

  1. <!doctype html>
  2. <html>
  3. <head>
  4. <script type="text/javascript" src="resizable.js"></script>
  5. <script type="text/javascript">
  6. resizable.initOnDocumentReady();
  7. </script>
  8. <style>
  9. .js-resizable {
  10. -moz-user-select: none;
  11. -o-user-select: none;
  12. -khtml-user-select: none;
  13. -webkit-user-select: none;
  14. -ms-user-select: none;
  15. user-select: none;
  16. }
  17. .js-resizable-corner {
  18. position: absolute;
  19. right: 0px;
  20. bottom: 0px;
  21. width: 10px;
  22. height: 10px;
  23. background: #000;
  24. }
  25. .outer {
  26. display: block;
  27. position: relative;
  28. width: 640px;
  29. height: 480px;
  30. margin: 20px;
  31. background-color: #EEE;
  32. }
  33. .inner {
  34. display: block;
  35. position: absolute;
  36. min-width: 100px;
  37. min-height: 50px;
  38. padding: 20px;
  39. }
  40. .inner--1 {
  41. left: 100px;
  42. top: 100px;
  43. width: 300px;
  44. height: 200px;
  45. background-color: #b1b1ff;
  46. }
  47. .inner--2 {
  48. left: 100px;
  49. top: 50px;
  50. background-color: #92f192;
  51. }
  52. .inner--3 {
  53. left: 400px;
  54. top: 200px;
  55. background-color: #ec7777;
  56. }
  57. </style>
  58. </head>
  59. <body>
  60. <div class="outer js-resizable-limiter">
  61. <div class="inner inner--1 js-resizable js-resizable-limiter">
  62. Content A
  63. <div class="inner inner--2 js-resizable">
  64. Sub-content A
  65. </div>
  66. </div>
  67. <div class="inner inner--3 js-resizable">
  68. Content B
  69. </div>
  70. </div>
  71. </body>
  72. </html>