Edit D:\chineseall_products\bak\digitalLib6\js\drag.js
??//http://boring.youngpup.net/2001/domdrag/ /** * Base class of Drag * ????? Element ??????????? event ???????????????????????????netvibes ??????????????????????????? dindin ?????????????????ttp://www.jroller.com/page/dindin/?anchor=pro_javascript_12 * @example: * Drag.init( header_element, element ); */ var Drag = { // ?????lement???????????????????lement obj: null , /** * @param: elementHeader used to drag.. * @param: element used to follow.. */ init: function(elementHeader, element) { // ?? start ????? onmousedown ?????????????? start elementHeader.onmousedown = Drag.start; // ?? element ??? header ?? obj ???????? header ??????????? elementHeader.obj = element; // ???????????????????? position = absolute ????????????????????????? onDrag ????? parse ????? if(isNaN(parseInt(element.style.left))) { element.style.left = "0px"; } if(isNaN(parseInt(element.style.top))) { element.style.top = "0px"; } // ????? Function????????????????? Drag.init ???????????????????? element.onDragStart = new Function(); element.onDragEnd = new Function(); element.onDrag = new Function(); }, // ?????????????????????????? event ?? start: function(event) { var element = Drag.obj = this.obj; // ???????????? event ??????????? event = Drag.fixE(event); // ?????????????? if(event.which != 1){ // ?????????????? return true ; } // ????????????????????????????? element.onDragStart(); // ????????? element.lastMouseX = event.clientX; element.lastMouseY = event.clientY; // ?????? document.onmouseup = Drag.end; document.onmousemove = Drag.drag; return false ; }, // Element???????????? drag: function(event) { event = Drag.fixE(event); if(event.which == 0 ) { return Drag.end(); } // ?????????Element var element = Drag.obj; // ?????? var _clientX = event.clientY; var _clientY = event.clientX; // ?????????????????? if(element.lastMouseX == _clientY && element.lastMouseY == _clientX) { return false ; } // ??? Element ????? var _lastX = parseInt(element.style.top); var _lastY = parseInt(element.style.left); // ?????? var newX, newY; // ??????????????????+??????????? newX = _lastY + _clientY - element.lastMouseX; newY = _lastX + _clientX - element.lastMouseY; // ??? element ???????? element.style.left = newX + "px"; element.style.top = newY + "px"; // ??? element ???????????????????? element.lastMouseX = _clientY; element.lastMouseY = _clientX; // ???????????????????? Drag ?????? element.onDrag(newX, newY); return false; }, // Element ???????????????????? end: function(event) { event = Drag.fixE(event); // ????????? document.onmousemove = null; document.onmouseup = null; // ?????? onDragEnd ??????????? obj var _onDragEndFuc = Drag.obj.onDragEnd(); // ????????bj ??? Drag.obj = null ; return _onDragEndFuc; }, // ???????????? event ??????????? fixE: function(ig_) { if( typeof ig_ == "undefined" ) { ig_ = window.event; } if( typeof ig_.layerX == "undefined" ) { ig_.layerX = ig_.offsetX; } if( typeof ig_.layerY == "undefined" ) { ig_.layerY = ig_.offsetY; } if( typeof ig_.which == "undefined" ) { ig_.which = ig_.button; } return ig_; } }; var DragDrop = Class.create(); DragDrop.prototype = { initialize: function(elementHeader_id , element_id){ var element = document.getElementById(element_id); var elementHeader = document.getElementById(elementHeader_id); this._dragStart = ((typeof this.start_Drag == "function") ? this.start_Drag : start_Drag); this._drag = ((typeof this.when_Drag == "function") ? this.when_Drag : when_Drag); this._dragEnd = ((typeof this.end_Drag == "function") ? this.end_Drag : end_Drag); this._afterDrag = ((typeof this.after_Drag == "function") ? this.after_Drag : after_Drag); this.isDragging = false; this.elm = element; this.header = $(elementHeader.id); this.hasIFrame = this.elm.getElementsByTagName("IFRAME").length > 0; if( this.header) { this.header.style.cursor = "move"; Drag.init( this.header, this.elm); this.elm.onDragStart = this._dragStart.bind(this); this.elm.onDrag = this._drag.bind(this); this.elm.onDragEnd = this._dragEnd.bind(this); } } }; /** * four function for Drag.. */ function start_Drag(){ var position = Position.positionedOffset(this.elm); var offLeft = position[0]; var offTop = position[1]; var offW = this.elm.offsetWidth; this.elm.style.width = offW + "px"; this.elm.style.position = "absolute"; this.elm.style.zIndex = 100; this.elm.style.left = offLeft + "px"; this.elm.style.top = offTop + "px"; this.isDragging = false; return false } function when_Drag(clientX , clientY){ } function end_Drag(){ if(this._afterDrag()){ } return true; } function after_Drag(){ }
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de