document.ele.onmousedown = function (evt) { startmove(this, evt) } document.ele.onmouseup = function (evt) { endmove(this, evt) } function startmove(ele, evt) { ele.ismoving = setTimeout(domove, 100); } function endmove(ele, evt) { ele.ismoving = clearTimeout(domove); } function domove() { // how do I get the cursor xy and the element object in here?!?! }