<script content= "Text/javascript" >
var imousedown = false;
var dragobject = null;
Number.prototype.nan0=function () {return isNaN (this) 0:this;}
Demo 0 Variables
var dragdrops = [];
var curtarget = null;
var lasttarget = null;
function Makedraggable (item) {
if (!item) return;
Item.onmousedown = function (EV) {
Dragobject = this;
Mouseoffset = Getmouseoffset (this, EV);
return false;
}
}
function Getmouseoffset (target, Ev) {
EV = EV | | window.event;
var docpos = getPosition (target);
var mousepos = mousecoords (EV);
return {x:mousepos.x-docpos.x, y:mousepos.y-docpos.y};
}
function GetPosition (e) {
var left = 0;
var top = 0;
while (e.offsetparent) {
Left + = E.offsetleft + (E.currentstyle? parseint (E.currentstyle.borderleftwidth)). NaN0 (): 0);
Top + = E.offsettop + (E.currentstyle? parseint (E.currentstyle.bordertopwidth)). NaN0 (): 0);
e = e.offsetparent;
}
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.