控制浏览器运动的几个按钮

<html>
<head>

<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body bgcolor="#000000" text="#999999" link="#33FF33" vlink="#33FF33" alink="#33FF33">
<script>
var xx
var v=1


function ml() {
clearTimeout(xx)
window.moveBy(-v, 0);

xx = setTimeout("ml()",140)
}
function mr() {
clearTimeout(xx)
window.moveBy(v, 0);
xx = setTimeout("mr()",140)
}
function mu() {
clearTimeout(xx)
window.moveBy(0, -v);
xx = setTimeout("mu()",140)
}
function md() {
clearTimeout(xx)
window.moveBy(0, v);
xx = setTimeout("md()",140)
}
function ws(){
clearTimeout(xx)
}
function adj(i){

if (i==1){v+=1; if (v>5)v-=1}
else {v-=1
if (v==0)v=1}
}
</script>
<DIV align=center>
<FORM>
   <INPUT οnclick=mu(v,0); type=button value=向上>
   
   <INPUT οnclick=ml(v,0); type=button value=向左>
   
   <INPUT οnclick=mr(0,v); type=button value=向右>
   
   <INPUT οnclick=md(0,v); type=button value=向下>
   
   <INPUT οnclick=ws(); type=button value=停止>
   <BR><BR><BR>
   <INPUT οnclick=adj(1); type=button value=加速>
   <INPUT οnclick=adj(0); type=button value=减速>
    <BR></FORM></DIV>
</body>
</html>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值