※ 彈來彈去的跑馬燈 ※
|
<BODY onload="pingpong();" background="jpg/01_bkg1.jpg"> <script language="JavaScript"> <!-- var yourwords = ". 彈來彈去的跑馬燈,不過可以顯示的訊息不多! ."; var buffer1=" "; var buffer2=" "; var message1=buffer1+yourwords+buffer2; var dir = "left"; var speed = 75; function pingpong() { if (dir == "left") { message2=message1.substring(2,message1.length)+" "; window.status=message2; setTimeout("pingpong();",speed); message1=message2; if (message1.substring(0,1) == ".") dir="right"; } else { message2=" "+message1.substring(0,message1.length-2); window.status=message2; setTimeout("pingpong();",speed); message1=message2; if (message1.substring(message1.length-1,message1.length) == ".") dir="left"; } } // --> </script> |