video2.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  4. <script type="text/javascript" src="/lib/jquery-3.4.1.js"></script>
  5. <script type="text/javascript" src="/lib/jquery-3.4.1.min.js"></script>
  6. <script src="/lib/jquery.min.js"></script>
  7. <style>
  8. body {
  9. margin: 0px;
  10. padding: 0px;
  11. font-size: 12px;
  12. text-align: center;
  13. }
  14. body>div {
  15. text-align: center;
  16. margin-right: auto;
  17. margin-left: auto;
  18. }
  19. .content {
  20. width: 900px;
  21. }
  22. .content .left {
  23. float: left;
  24. width: 20%;
  25. border: 1px solid #FF0000;
  26. margin: 3px;
  27. }
  28. .content .center {
  29. float: left;
  30. border: 1px solid #FF0000;
  31. margin: 3px;
  32. width: 58%
  33. }
  34. .content .right {
  35. float: right;
  36. width: 20%;
  37. border: 1px solid #FF0000;
  38. margin: 3px
  39. }
  40. .mo {
  41. height: auto;
  42. border: 1px solid #CCC;
  43. margin: 3px;
  44. background: #FFF
  45. }
  46. .mo h1 {
  47. background: #ECF9FF;
  48. height: 18px;
  49. padding: 3px;
  50. cursor: move
  51. }
  52. .mo .nr {
  53. height: 80px;
  54. border: 1px solid #F3F3F3;
  55. margin: 2px
  56. }
  57. h1 {
  58. margin: 0px;
  59. padding: 0px;
  60. text-align: left;
  61. font-size: 12px
  62. }
  63. </style>
  64. <script> var dragobj = {}
  65. window.onerror = function () { return false }
  66. function on_ini() { String.prototype.inc = function (s) { return this.indexOf(s) > -1 ? true : false }
  67. var agent = navigator.userAgent
  68. window.isOpr = agent.inc("Opera")
  69. window.isIE = agent.inc("IE") && !isOpr
  70. window.isMoz = agent.inc("Mozilla") && !isOpr && !isIE
  71. if (isMoz) { Event.prototype.__defineGetter__("x", function () { return this.clientX + 2 })
  72. Event.prototype.__defineGetter__("y", function () { return this.clientY + 2 }) } basic_ini() }
  73. function basic_ini() { window.$ = function (obj) { return typeof (obj) == "string" ? document.getElementById(obj) : obj }
  74. window.oDel = function (obj) { if ($(obj) != null) { $(obj).parentNode.removeChild($(obj)) } } } window.onload = function () { on_ini()
  75. var o = document.getElementsByTagName("h1")
  76. for (var i = 0; i < o.length; i++) { o[i].onmousedown = function (e) { if (dragobj.o != null) return false
  77. e = e || event
  78. dragobj.o = this.parentNode
  79. dragobj.xy = getxy(dragobj.o)
  80. dragobj.xx = new Array((e.x - dragobj.xy[1]), (e.y - dragobj.xy[0]))
  81. dragobj.o.style.width = dragobj.xy[2] + "px"
  82. dragobj.o.style.height = dragobj.xy[3] + "px"
  83. dragobj.o.style.left = (e.x - dragobj.xx[0]) + "px"
  84. dragobj.o.style.top = (e.y - dragobj.xx[1]) + "px"
  85. dragobj.o.style.position = "absolute"
  86. var om = document.createElement("div")
  87. dragobj.otemp = om
  88. om.style.width = dragobj.xy[2] + "px"
  89. om.style.height = dragobj.xy[3] + "px"
  90. dragobj.o.parentNode.insertBefore(om, dragobj.o)
  91. return false
  92. }
  93. }
  94. }
  95. document.onselectstart = function () { return false }
  96. window.onfocus = function () { document.onmouseup() }
  97. window.onblur = function () { document.onmouseup() }
  98. document.onmouseup = function () { if (dragobj.o != null) { dragobj.o.style.width = "auto"
  99. dragobj.o.style.height = "auto"
  100. dragobj.otemp.parentNode.insertBefore(dragobj.o, dragobj.otemp)
  101. dragobj.o.style.position = ""
  102. oDel(dragobj.otemp)
  103. dragobj = {} } }
  104. document.onmousemove = function (e) { e = e || event
  105. if (dragobj.o != null) { dragobj.o.style.left = (e.x - dragobj.xx[0]) + "px"
  106. dragobj.o.style.top = (e.y - dragobj.xx[1]) + "px"
  107. createtmpl(e) } }
  108. function getxy(e) { var a = new Array()
  109. var t = e.offsetTop; var l = e.offsetLeft; var w = e.offsetWidth;
  110. var h = e.offsetHeight; while (e = e.offsetParent) { t += e.offsetTop; l += e.offsetLeft; } a[0] = t; a[1] = l; a[2] = w; a[3] = h
  111. return a; } function inner(o, e) { var a = getxy(o)
  112. if (e.x > a[1] && e.x < (a[1] + a[2]) && e.y > a[0] && e.y < (a[0] + a[3])) { if (e.y < (a[0] + a[3] / 2)) return 1; else return 2; } else return 0; } function createtmpl(e) { for (var i = 0; i < 12; i++) { if ($("m" + i) == dragobj.o) continue
  113. var b = inner($("m" + i), e)
  114. if (b == 0) continue
  115. dragobj.otemp.style.width = $("m" + i).offsetWidth
  116. if (b == 1) { $("m" + i).parentNode.insertBefore(dragobj.otemp, $("m" + i)) } else { if ($("m" + i).nextSibling == null) { $("m" + i).parentNode.appendChild(dragobj.otemp) } else { $("m" + i).parentNode.insertBefore(dragobj.otemp, $("m" + i).nextSibling) } } return } for (var j = 0; j < 3; j++) { if ($("dom" + j).innerHTML.inc("div") || $("dom" + j).innerHTML.inc("DIV")) continue
  117. var op = getxy($("dom" + j))
  118. if (e.x > (op[1] + 10) && e.x < (op[1] + op[2] - 10)) { $("dom" + j).appendChild(dragobj.otemp)
  119. dragobj.otemp.style.width = (op[2] - 10) + "px" } } } </script>
  120. </head>
  121. <body>
  122. <div class=content style="width: 100%;height:100%;">
  123. <div class=left id=dom0>
  124. <div class=mo id=m0>
  125. <h1>dom0</h1>
  126. <div class="nr"></div>
  127. </div>
  128. <div class=mo id=m1>
  129. <h1>dom1</h1>
  130. <div class="nr"></div>
  131. </div>
  132. <div class=mo id=m2>
  133. <h1>dom2</h1>
  134. <div class="nr"></div>
  135. </div>
  136. <div class=mo id=m3>
  137. <h1>dom3</h1>
  138. <div class="nr"></div>
  139. </div>
  140. </div>
  141. <div class=center id=dom1>
  142. <div class=mo id=m4>
  143. <h1>dom4</h1>
  144. <div class="nr"></div>
  145. </div>
  146. <div class=mo id=m5>
  147. <h1>dom5</h1>
  148. <div class="nr"></div>
  149. </div>
  150. <div class=mo id=m6>
  151. <h1>dom6</h1>
  152. <div class="nr"></div>
  153. </div>
  154. <div class=mo id=m7>
  155. <h1>dom7</h1>
  156. <div class="nr"></div>
  157. </div>
  158. </div>
  159. <div class=right id=dom2>
  160. <div class=mo id=m8>
  161. <h1>dom8</h1>
  162. <div class="nr"></div>
  163. </div>
  164. <div class=mo id=m9>
  165. <h1>dom9</h1>
  166. <div class="nr"></div>
  167. </div>
  168. <div class=mo id=m10>
  169. <h1>dom10</h1>
  170. <div class="nr"></div>
  171. </div>
  172. <div class=mo id=m11>
  173. <h1>dom11</h1>
  174. <div class="nr"></div>
  175. </div>
  176. </div>
  177. </div>
  178. </body>
  179. </html>