designer.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568
  1. var isIE = (document.all) ? true : false;
  2. var dobj = function (id) {
  3. return "string" == typeof id ? document.getElementById(id) : id;
  4. };
  5. var Class = {
  6. create: function() {
  7. return function() { this.initialize.apply(this, arguments); }
  8. }
  9. }
  10. var Extend = function(destination, source) {
  11. for (var property in source) {
  12. destination[property] = source[property];
  13. }
  14. }
  15. var Bind = function(object, fun) {
  16. return function() {
  17. return fun.apply(object, arguments);
  18. }
  19. }
  20. var BindAsEventListener = function(object, fun) {
  21. var args = Array.prototype.slice.call(arguments).slice(2);
  22. return function(event) {
  23. return fun.apply(object, [event || window.event].concat(args));
  24. }
  25. }
  26. var CurrentStyle = function(element){
  27. return element.currentStyle || document.defaultView.getComputedStyle(element, null);
  28. }
  29. function addEventHandler(oTarget, sEventType, fnHandler) {
  30. if (oTarget.addEventListener) {
  31. oTarget.addEventListener(sEventType, fnHandler, false);
  32. } else if (oTarget.attachEvent) {
  33. oTarget.attachEvent("on" + sEventType, fnHandler);
  34. } else {
  35. oTarget["on" + sEventType] = fnHandler;
  36. }
  37. };
  38. function removeEventHandler(oTarget, sEventType, fnHandler) {
  39. if (oTarget.removeEventListener) {
  40. oTarget.removeEventListener(sEventType, fnHandler, false);
  41. } else if (oTarget.detachEvent) {
  42. oTarget.detachEvent("on" + sEventType, fnHandler);
  43. } else {
  44. oTarget["on" + sEventType] = null;
  45. }
  46. };
  47. //缩放程序
  48. var Resize = Class.create();
  49. Resize.prototype = {
  50. //缩放对象
  51. initialize: function(obj, options) {
  52. this._obj = obj.get(0);//缩放对象
  53. this._styleWidth = this._styleHeight = this._styleLeft = this._styleTop = 0;//样式参数
  54. this._sideRight = this._sideDown = this._sideLeft = this._sideUp = 0;//坐标参数
  55. this._fixLeft = this._fixTop = 0;//定位参数
  56. this._scaleLeft = this._scaleTop = 0;//定位坐标
  57. this._mxSet = function(){};//范围设置程序
  58. this._mxRightWidth = this._mxDownHeight = this._mxUpHeight = this._mxLeftWidth = 0;//范围参数
  59. this._mxScaleWidth = this._mxScaleHeight = 0;//比例范围参数
  60. this._fun = function(){};//缩放执行程序
  61. //获取边框宽度
  62. var _style = CurrentStyle(this._obj);
  63. this._borderX = (parseInt(_style.borderLeftWidth) || 0) + (parseInt(_style.borderRightWidth) || 0);
  64. this._borderY = (parseInt(_style.borderTopWidth) || 0) + (parseInt(_style.borderBottomWidth) || 0);
  65. //事件对象(用于绑定移除事件)
  66. this._fR = BindAsEventListener(this, this.Resize);
  67. this._fS = Bind(this, this.Stop);
  68. this.SetOptions(options);
  69. //范围限制
  70. this.Max = !!this.options.Max;
  71. this._mxContainer = $(this.options.mxContainer).get(0) || null;
  72. this.mxLeft = Math.round(this.options.mxLeft);
  73. this.mxRight = Math.round(this.options.mxRight);
  74. this.mxTop = Math.round(this.options.mxTop);
  75. this.mxBottom = Math.round(this.options.mxBottom);
  76. //宽高限制
  77. this.Min = !!this.options.Min;
  78. this.minWidth = Math.round(this.options.minWidth);
  79. this.minHeight = Math.round(this.options.minHeight);
  80. //按比例缩放
  81. this.Scale = !!this.options.Scale;
  82. this.Ratio = Math.max(this.options.Ratio, 0);
  83. this.onResize = this.options.onResize;
  84. this._obj.style.position = "absolute";
  85. !this._mxContainer || CurrentStyle(this._mxContainer).position == "relative" || (this._mxContainer.style.position = "relative");
  86. },
  87. //设置默认属性
  88. SetOptions: function(options) {
  89. this.options = {//默认值
  90. Max: false,//是否设置范围限制(为true时下面mx参数有用)
  91. mxContainer:"",//指定限制在容器内
  92. mxLeft: 0,//左边限制
  93. mxRight: 9999,//右边限制
  94. mxTop: 0,//上边限制
  95. mxBottom: 9999,//下边限制
  96. Min: false,//是否最小宽高限制(为true时下面min参数有用)
  97. minWidth: 50,//最小宽度
  98. minHeight: 50,//最小高度
  99. Scale: false,//是否按比例缩放
  100. Ratio: 0,//缩放比例(宽/高)
  101. onResize: function(){}//缩放时执行
  102. };
  103. Extend(this.options, options || {});
  104. },
  105. //设置触发对象
  106. Set: function(resize, side) {
  107. var fun;
  108. if(!resize) return;
  109. //根据方向设置
  110. switch (side.toLowerCase()) {
  111. case "up" :
  112. fun = this.Up;
  113. break;
  114. case "down" :
  115. fun = this.Down;
  116. break;
  117. case "left" :
  118. fun = this.Left;
  119. break;
  120. case "right" :
  121. fun = this.Right;
  122. break;
  123. case "left-up" :
  124. fun = this.LeftUp;
  125. break;
  126. case "right-up" :
  127. fun = this.RightUp;
  128. break;
  129. case "left-down" :
  130. fun = this.LeftDown;
  131. break;
  132. case "right-down" :
  133. default :
  134. fun = this.RightDown;
  135. };
  136. //设置触发对象
  137. addEventHandler(resize.get(0), "mousedown", BindAsEventListener(this, this.Start, fun));
  138. },
  139. //准备缩放
  140. Start: function(e, fun, touch) {
  141. //防止冒泡(跟拖放配合时设置)
  142. e.stopPropagation ? e.stopPropagation() : (e.cancelBubble = true);
  143. //设置执行程序
  144. this._fun = fun;
  145. //样式参数值
  146. this._styleWidth = this._obj.clientWidth;
  147. this._styleHeight = this._obj.clientHeight;
  148. this._styleLeft = this._obj.offsetLeft;
  149. this._styleTop = this._obj.offsetTop;
  150. //四条边定位坐标
  151. this._sideLeft = e.clientX - this._styleWidth;
  152. this._sideRight = e.clientX + this._styleWidth;
  153. this._sideUp = e.clientY - this._styleHeight;
  154. this._sideDown = e.clientY + this._styleHeight;
  155. //top和left定位参数
  156. this._fixLeft = this._styleLeft + this._styleWidth;
  157. this._fixTop = this._styleTop + this._styleHeight;
  158. //缩放比例
  159. if(this.Scale){
  160. //设置比例
  161. this.Ratio = Math.max(this.Ratio, 0) || this._styleWidth / this._styleHeight;
  162. //left和top的定位坐标
  163. this._scaleLeft = this._styleLeft + this._styleWidth / 2;
  164. this._scaleTop = this._styleTop + this._styleHeight / 2;
  165. };
  166. //范围限制
  167. if(this.Max){
  168. //设置范围参数
  169. var mxLeft = this.mxLeft, mxRight = this.mxRight, mxTop = this.mxTop, mxBottom = this.mxBottom;
  170. //如果设置了容器,再修正范围参数
  171. if(!!this._mxContainer){
  172. mxLeft = Math.max(mxLeft, 0);
  173. mxTop = Math.max(mxTop, 0);
  174. mxRight = Math.min(mxRight, this._mxContainer.clientWidth);
  175. mxBottom = Math.min(mxBottom, this._mxContainer.clientHeight);
  176. };
  177. //根据最小值再修正
  178. mxRight = Math.max(mxRight, mxLeft + (this.Min ? this.minWidth : 0) + this._borderX);
  179. mxBottom = Math.max(mxBottom, mxTop + (this.Min ? this.minHeight : 0) + this._borderY);
  180. //由于转向时要重新设置所以写成function形式
  181. this._mxSet = function(){
  182. this._mxRightWidth = mxRight - this._styleLeft - this._borderX;
  183. this._mxDownHeight = mxBottom - this._styleTop - this._borderY;
  184. this._mxUpHeight = Math.max(this._fixTop - mxTop, this.Min ? this.minHeight : 0);
  185. this._mxLeftWidth = Math.max(this._fixLeft - mxLeft, this.Min ? this.minWidth : 0);
  186. };
  187. this._mxSet();
  188. //有缩放比例下的范围限制
  189. if(this.Scale){
  190. this._mxScaleWidth = Math.min(this._scaleLeft - mxLeft, mxRight - this._scaleLeft - this._borderX) * 2;
  191. this._mxScaleHeight = Math.min(this._scaleTop - mxTop, mxBottom - this._scaleTop - this._borderY) * 2;
  192. };
  193. };
  194. //mousemove时缩放 mouseup时停止
  195. addEventHandler(document, "mousemove", this._fR);
  196. addEventHandler(document, "mouseup", this._fS);
  197. if(isIE){
  198. addEventHandler(this._obj, "losecapture", this._fS);
  199. this._obj.setCapture();
  200. }else{
  201. addEventHandler(window, "blur", this._fS);
  202. e.preventDefault();
  203. };
  204. },
  205. //缩放
  206. Resize: function(e) {
  207. //清除选择
  208. window.getSelection ? window.getSelection().removeAllRanges() : document.selection.empty();
  209. //执行缩放程序
  210. this._fun(e);
  211. //设置样式,变量必须大于等于0否则ie出错
  212. with(this._obj.style){
  213. width = this._styleWidth + "px"; height = this._styleHeight + "px";
  214. top = this._styleTop + "px"; left = this._styleLeft + "px";
  215. }
  216. //附加程序
  217. this.onResize();
  218. },
  219. //缩放程序
  220. //上
  221. Up: function(e) {
  222. this.RepairY(this._sideDown - e.clientY, this._mxUpHeight);
  223. this.RepairTop();
  224. this.TurnDown(this.Down);
  225. },
  226. //下
  227. Down: function(e) {
  228. this.RepairY(e.clientY - this._sideUp, this._mxDownHeight);
  229. this.TurnUp(this.Up);
  230. },
  231. //右
  232. Right: function(e) {
  233. this.RepairX(e.clientX - this._sideLeft, this._mxRightWidth);
  234. this.TurnLeft(this.Left);
  235. },
  236. //左
  237. Left: function(e) {
  238. this.RepairX(this._sideRight - e.clientX, this._mxLeftWidth);
  239. this.RepairLeft();
  240. this.TurnRight(this.Right);
  241. },
  242. //右下
  243. RightDown: function(e) {
  244. this.RepairAngle(
  245. e.clientX - this._sideLeft, this._mxRightWidth,
  246. e.clientY - this._sideUp, this._mxDownHeight
  247. );
  248. this.TurnLeft(this.LeftDown) || this.Scale || this.TurnUp(this.RightUp);
  249. },
  250. //右上
  251. RightUp: function(e) {
  252. this.RepairAngle(
  253. e.clientX - this._sideLeft, this._mxRightWidth,
  254. this._sideDown - e.clientY, this._mxUpHeight
  255. );
  256. this.RepairTop();
  257. this.TurnLeft(this.LeftUp) || this.Scale || this.TurnDown(this.RightDown);
  258. },
  259. //左下
  260. LeftDown: function(e) {
  261. this.RepairAngle(
  262. this._sideRight - e.clientX, this._mxLeftWidth,
  263. e.clientY - this._sideUp, this._mxDownHeight
  264. );
  265. this.RepairLeft();
  266. this.TurnRight(this.RightDown) || this.Scale || this.TurnUp(this.LeftUp);
  267. },
  268. //左上
  269. LeftUp: function(e) {
  270. this.RepairAngle(
  271. this._sideRight - e.clientX, this._mxLeftWidth,
  272. this._sideDown - e.clientY, this._mxUpHeight
  273. );
  274. this.RepairTop(); this.RepairLeft();
  275. this.TurnRight(this.RightUp) || this.Scale || this.TurnDown(this.LeftDown);
  276. },
  277. //修正程序
  278. //水平方向
  279. RepairX: function(iWidth, mxWidth) {
  280. iWidth = this.RepairWidth(iWidth, mxWidth);
  281. if(this.Scale){
  282. var iHeight = this.RepairScaleHeight(iWidth);
  283. if(this.Max && iHeight > this._mxScaleHeight){
  284. iHeight = this._mxScaleHeight;
  285. iWidth = this.RepairScaleWidth(iHeight);
  286. }else if(this.Min && iHeight < this.minHeight){
  287. var tWidth = this.RepairScaleWidth(this.minHeight);
  288. if(tWidth < mxWidth){ iHeight = this.minHeight; iWidth = tWidth; }
  289. }
  290. this._styleHeight = iHeight;
  291. this._styleTop = this._scaleTop - iHeight / 2;
  292. }
  293. this._styleWidth = iWidth;
  294. },
  295. //垂直方向
  296. RepairY: function(iHeight, mxHeight) {
  297. iHeight = this.RepairHeight(iHeight, mxHeight);
  298. if(this.Scale){
  299. var iWidth = this.RepairScaleWidth(iHeight);
  300. if(this.Max && iWidth > this._mxScaleWidth){
  301. iWidth = this._mxScaleWidth;
  302. iHeight = this.RepairScaleHeight(iWidth);
  303. }else if(this.Min && iWidth < this.minWidth){
  304. var tHeight = this.RepairScaleHeight(this.minWidth);
  305. if(tHeight < mxHeight){ iWidth = this.minWidth; iHeight = tHeight; }
  306. }
  307. this._styleWidth = iWidth;
  308. this._styleLeft = this._scaleLeft - iWidth / 2;
  309. }
  310. this._styleHeight = iHeight;
  311. },
  312. //对角方向
  313. RepairAngle: function(iWidth, mxWidth, iHeight, mxHeight) {
  314. iWidth = this.RepairWidth(iWidth, mxWidth);
  315. if(this.Scale){
  316. iHeight = this.RepairScaleHeight(iWidth);
  317. if(this.Max && iHeight > mxHeight){
  318. iHeight = mxHeight;
  319. iWidth = this.RepairScaleWidth(iHeight);
  320. }else if(this.Min && iHeight < this.minHeight){
  321. var tWidth = this.RepairScaleWidth(this.minHeight);
  322. if(tWidth < mxWidth){ iHeight = this.minHeight; iWidth = tWidth; }
  323. }
  324. }else{
  325. iHeight = this.RepairHeight(iHeight, mxHeight);
  326. }
  327. this._styleWidth = iWidth;
  328. this._styleHeight = iHeight;
  329. },
  330. //top
  331. RepairTop: function() {
  332. this._styleTop = this._fixTop - this._styleHeight;
  333. },
  334. //left
  335. RepairLeft: function() {
  336. this._styleLeft = this._fixLeft - this._styleWidth;
  337. },
  338. //height
  339. RepairHeight: function(iHeight, mxHeight) {
  340. iHeight = Math.min(this.Max ? mxHeight : iHeight, iHeight);
  341. iHeight = Math.max(this.Min ? this.minHeight : iHeight, iHeight, 0);
  342. return iHeight;
  343. },
  344. //width
  345. RepairWidth: function(iWidth, mxWidth) {
  346. iWidth = Math.min(this.Max ? mxWidth : iWidth, iWidth);
  347. iWidth = Math.max(this.Min ? this.minWidth : iWidth, iWidth, 0);
  348. return iWidth;
  349. },
  350. //比例高度
  351. RepairScaleHeight: function(iWidth) {
  352. return Math.max(Math.round((iWidth + this._borderX) / this.Ratio - this._borderY), 0);
  353. },
  354. //比例宽度
  355. RepairScaleWidth: function(iHeight) {
  356. return Math.max(Math.round((iHeight + this._borderY) * this.Ratio - this._borderX), 0);
  357. },
  358. //转向程序
  359. //转右
  360. TurnRight: function(fun) {
  361. if(!(this.Min || this._styleWidth)){
  362. this._fun = fun;
  363. this._sideLeft = this._sideRight;
  364. this.Max && this._mxSet();
  365. return true;
  366. }
  367. },
  368. //转左
  369. TurnLeft: function(fun) {
  370. if(!(this.Min || this._styleWidth)){
  371. this._fun = fun;
  372. this._sideRight = this._sideLeft;
  373. this._fixLeft = this._styleLeft;
  374. this.Max && this._mxSet();
  375. return true;
  376. }
  377. },
  378. //转上
  379. TurnUp: function(fun) {
  380. if(!(this.Min || this._styleHeight)){
  381. this._fun = fun;
  382. this._sideDown = this._sideUp;
  383. this._fixTop = this._styleTop;
  384. this.Max && this._mxSet();
  385. return true;
  386. }
  387. },
  388. //转下
  389. TurnDown: function(fun) {
  390. if(!(this.Min || this._styleHeight)){
  391. this._fun = fun;
  392. this._sideUp = this._sideDown;
  393. this.Max && this._mxSet();
  394. return true;
  395. }
  396. },
  397. //停止缩放
  398. Stop: function() {
  399. removeEventHandler(document, "mousemove", this._fR);
  400. removeEventHandler(document, "mouseup", this._fS);
  401. if(isIE){
  402. removeEventHandler(this._obj, "losecapture", this._fS);
  403. this._obj.releaseCapture();
  404. }else{
  405. removeEventHandler(window, "blur", this._fS);
  406. }
  407. }
  408. };
  409. //拖放程序
  410. var Drag = Class.create();
  411. Drag.prototype = {
  412. //拖放对象
  413. initialize: function(drag, options) {
  414. this.Drag = drag.get(0);//拖放对象
  415. this._x = this._y = 0;//记录鼠标相对拖放对象的位置
  416. this._marginLeft = this._marginTop = 0;//记录margin
  417. //事件对象(用于绑定移除事件)
  418. this._fM = BindAsEventListener(this, this.Move);
  419. this._fS = Bind(this, this.Stop);
  420. this.SetOptions(options);
  421. this.Limit = !!this.options.Limit;
  422. this.mxLeft = parseInt(this.options.mxLeft);
  423. this.mxRight = parseInt(this.options.mxRight);
  424. this.mxTop = parseInt(this.options.mxTop);
  425. this.mxBottom = parseInt(this.options.mxBottom);
  426. this.LockX = !!this.options.LockX;
  427. this.LockY = !!this.options.LockY;
  428. this.Lock = !!this.options.Lock;
  429. this.onStart = this.options.onStart;
  430. this.onMove = this.options.onMove;
  431. this.onStop = this.options.onStop;
  432. this._Handle = $(this.options.Handle).get(0) || this.Drag;
  433. this._mxContainer = $(this.options.mxContainer).get(0) || null;
  434. this.Drag.style.position = "absolute";
  435. //透明
  436. if(isIE && !!this.options.Transparent){
  437. //填充拖放对象
  438. with(this._Handle.appendChild(document.createElement("div")).style){
  439. width = height = "100%"; backgroundColor = "#fff"; filter = "alpha(opacity:0)"; fontSize = 0;
  440. }
  441. }
  442. //修正范围
  443. this.Repair();
  444. addEventHandler(this._Handle, "mousedown", BindAsEventListener(this, this.Start));
  445. },
  446. //设置默认属性
  447. SetOptions: function(options) {
  448. this.options = {//默认值
  449. Handle: "",//设置触发对象(不设置则使用拖放对象)
  450. Limit: false,//是否设置范围限制(为true时下面参数有用,可以是负数)
  451. mxLeft: 0,//左边限制
  452. mxRight: 9999,//右边限制
  453. mxTop: 0,//上边限制
  454. mxBottom: 9999,//下边限制
  455. mxContainer: "",//指定限制在容器内
  456. LockX: false,//是否锁定水平方向拖放
  457. LockY: false,//是否锁定垂直方向拖放
  458. Lock: false,//是否锁定
  459. Transparent: false,//是否透明
  460. onStart: function(){},//开始移动时执行
  461. onMove: function(){},//移动时执行
  462. onStop: function(){}//结束移动时执行
  463. };
  464. Extend(this.options, options || {});
  465. },
  466. //准备拖动
  467. Start: function(oEvent) {
  468. if(this.Lock){ return; }
  469. this.Repair();
  470. //记录鼠标相对拖放对象的位置
  471. this._x = oEvent.clientX - this.Drag.offsetLeft;
  472. this._y = oEvent.clientY - this.Drag.offsetTop;
  473. //记录margin
  474. this._marginLeft = parseInt(CurrentStyle(this.Drag).marginLeft) || 0;
  475. this._marginTop = parseInt(CurrentStyle(this.Drag).marginTop) || 0;
  476. //mousemove时移动 mouseup时停止
  477. addEventHandler(document, "mousemove", this._fM);
  478. addEventHandler(document, "mouseup", this._fS);
  479. if(isIE){
  480. //焦点丢失
  481. addEventHandler(this._Handle, "losecapture", this._fS);
  482. //设置鼠标捕获
  483. this._Handle.setCapture();
  484. }else{
  485. //焦点丢失
  486. addEventHandler(window, "blur", this._fS);
  487. //阻止默认动作
  488. oEvent.preventDefault();
  489. };
  490. //附加程序
  491. this.onStart();
  492. },
  493. //修正范围
  494. Repair: function() {
  495. if(this.Limit){
  496. //修正错误范围参数
  497. this.mxRight = Math.max(this.mxRight, this.mxLeft + this.Drag.offsetWidth);
  498. this.mxBottom = Math.max(this.mxBottom, this.mxTop + this.Drag.offsetHeight);
  499. //如果有容器必须设置position为relative或absolute来相对或绝对定位,并在获取offset之前设置
  500. !this._mxContainer || CurrentStyle(this._mxContainer).position == "relative" || CurrentStyle(this._mxContainer).position == "absolute" || (this._mxContainer.style.position = "relative");
  501. }
  502. },
  503. //拖动
  504. Move: function(oEvent) {
  505. //判断是否锁定
  506. if(this.Lock){ this.Stop(); return; };
  507. //清除选择
  508. window.getSelection ? window.getSelection().removeAllRanges() : document.selection.empty();
  509. //设置移动参数
  510. var iLeft = oEvent.clientX - this._x, iTop = oEvent.clientY - this._y;
  511. //设置范围限制
  512. if(this.Limit){
  513. //设置范围参数
  514. var mxLeft = this.mxLeft, mxRight = this.mxRight, mxTop = this.mxTop, mxBottom = this.mxBottom;
  515. //如果设置了容器,再修正范围参数
  516. if(!!this._mxContainer){
  517. mxLeft = Math.max(mxLeft, 0);
  518. mxTop = Math.max(mxTop, 0);
  519. mxRight = Math.min(mxRight, this._mxContainer.clientWidth);
  520. mxBottom = Math.min(mxBottom, this._mxContainer.clientHeight);
  521. };
  522. //修正移动参数
  523. iLeft = Math.max(Math.min(iLeft, mxRight - this.Drag.offsetWidth), mxLeft);
  524. iTop = Math.max(Math.min(iTop, mxBottom - this.Drag.offsetHeight), mxTop);
  525. }
  526. //设置位置,并修正margin
  527. if(!this.LockX){ this.Drag.style.left = iLeft - this._marginLeft + "px"; }
  528. if(!this.LockY){ this.Drag.style.top = iTop - this._marginTop + "px"; }
  529. //附加程序
  530. this.onMove();
  531. },
  532. //停止拖动
  533. Stop: function() {
  534. //移除事件
  535. removeEventHandler(document, "mousemove", this._fM);
  536. removeEventHandler(document, "mouseup", this._fS);
  537. if(isIE){
  538. removeEventHandler(this._Handle, "losecapture", this._fS);
  539. this._Handle.releaseCapture();
  540. }else{
  541. removeEventHandler(window, "blur", this._fS);
  542. };
  543. //附加程序
  544. this.onStop();
  545. }
  546. };