125、键盘改变窗口大小

125、键盘改变窗口大小

脚本说明:

把如下代码加入<body>区域中

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

function movepage()

{

var direction =event.keyCode

switch(direction){

case 39:

window.moveTo(0, 0);

window.resizeBy(10, 0);

window.resizeBy(0, 0);

break

case 37:

window.moveTo(0, 0);

window.resizeBy(-10, 0);

window.resizeBy(0, 0);

break

case 38:

window.moveTo(0, 0);

window.resizeBy(0, 0);

window.resizeBy(0, -10);

break

case 40:

window.moveTo(0, 0);

window.moveBy(0, 0);

window.resizeBy(0, 10);

break

default:

break

}

}

//  End -->

</script>

 

 

第二步:把<body>中的内容改为:

<BODY onLoad="top.window.focus()" onkeydown="movepage()">

 

Write a comment

Comments: 0