08/03/10 12:45:53
>>656
昔、俺がした質問。
>マウスドラッグでウィンドウの移動を行いたいのですがwindow.moveBy() でアクセスが拒否されます。
>右ボタンならドラッグできるのですが左ボタンでドラッグするにはどうすればよいでしょうか?
<html>
<head>
<hta:application border="none"/>
<script>
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() {
window.moveBy(window.event.screenX - move.x, window.event.screenY - move.y);
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></head>
<body onmousedown="mouseDown()">ドラッグテスト</body></html>