113、用上下左右键移动页面

113、用上下左右键移动页面

脚本说明:

第一步:把如下代码加入<body>区域中

<script language="JavaScript">

function movepage()

{

var direction =event.keyCode

switch(direction){

case 39:

window.moveBy(15, 0);

window.moveBy(0, 0);

break

case 37:

window.moveBy(-15, 0);

window.moveBy(0, 0);

break

case 38:

window.moveBy(0, 0);

window.moveBy(0, -15);

break

case 40:

window.moveBy(0, 0);

window.moveBy(0, 15);

break

default:

break

}

}

//  End -->

</script>

 

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

<body bgcolor="#fef4d9" onLoad="top.window.focus()" onkeydown="movepage()">

 

Write a comment

Comments: 0