08/03/11 02:26:06
右クリック仕様だ。
スクロールバーだと左ボタンでもついてくるな。visitaだが。
<html><hta:application border="none" contextmenu='no'/>
<body onmousedown="mouseDown()"><div id=d>ドラッグテスト</div><body></html>
<script>
resizeTo(200,100);
d.style.height=1300;
var move = new Object();
function mouseDown() {
document.body.setCapture();
move.x = window.event.screenX;
move.y = window.event.screenY;
document.body.attachEvent("onmousemove", mouseMove);
document.body.attachEvent("onmouseup", mouseUp);
}
function mouseMove() {
try{
moveBy(window.event.screenX - move.x, window.event.screenY - move.y)
}catch(e){;}
move.x = window.event.screenX;
move.y = window.event.screenY;
}
function mouseUp() {
document.body.detachEvent("onmousemove", mouseMove);
document.body.detachEvent("onmouseup", mouseUp);
document.body.releaseCapture();
}
</script>