185、可调节速度的撞击

185、可调节速度的撞击

脚本说明:

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

<script LANGUAGE="JavaScript">

 

   var speed=500;

   var hellotext="1";

   var thetext="";

   var started=false;

   var step=0;

   var times=1;

function welcometext(){

  times--;if(times==0){

 if(started==false){started=true;

  document.forms[0].message.value=hellotext;

  setTimeout("anim()",1)}thetext=hellotext}}

function showformtext(txt){

  thetext=txt;

  setTimeout(welcometext());times++}

function anim(){step++;if(step==15){step=1}

if(step==1){document.forms[0].message.value='Ping-Pong*____________|_____________Ping-Pong'}

 

if(step==2){document.forms[0].message.value='Ping-Pong_____________|____________*Pign-Pong'}

 

if(step==3){document.forms[0].message.value='Ping-Pong____*________|_____________Ping-Pong'}

 

if(step==4){document.forms[0].message.value='Ping-Pong_____________|________*____Ping-Pong'}

 

if(step==5){document.forms[0].message.value='Ping-Pong________*____|_____________Ping-Pong'}

 

if(step==6){document.forms[0].message.value='Ping-Pong_____________|____*________Ping-Pong'}

 

if(step==7){document.forms[0].message.value='Ping-Pong____________*|_____________Ping-Pong'}

 

if(step==8){document.forms[0].message.value='Ping-Pong_____________|*____________Ping-Pong'}

 

if(step==9){document.forms[0].message.value='Ping-Pong_____________|___*_________Ping-Pong'}

 

if(step==10){document.forms[0].message.value='Ping-Pong_________*___|_____________Ping-Pong'}

 

if(step==11){document.forms[0].message.value='Ping-Pong_____________|______*______Ping-Pong'}

 

if(step==12){document.forms[0].message.value='Ping-Pong______*______|_____________Ping-Pong'}

 

if(step==13){document.forms[0].message.value='Ping-Pong_____________|__________*__Ping-Pong'}

 

if(step==14){document.forms[0].message.value='Ping-Pong__*__________|_____________Ping-Pong'}

 

if(step==15){document.forms[0].message.value='Ping-Pong_____________|_____________Ping-Pong'}

  setTimeout("anim()",speed)}

function delay(){if(speed==500){speed=10}else{speed=500}}

 

</script>

<form><INPUT Type="text" Name="message" Size="44"><p>

<INPUT Type="button" Value="快速/减速" onClick="delay()"></form>

 

 

 

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

<body bgcolor="#fef4d9" onLoad="welcometext()">

 

Write a comment

Comments: 0