<div class="codetitle"> <span><a style="CURSOR: pointer" data="121" class="copybut" id="copybut121" onclick="doCopy('code121')"><u>複製程式碼</u></a></span> 程式碼如下:</div> <div class="codebody" id="code121"> <br>BR>"http://www.w3.org/TR/html4/loose.dtd"> <br> <br> <br><meta http-equiv=" Content-Type" content="text/html; charset=gb2312"> <br><title>點名</title> <br><script language="javascript" type="text/javascript"> <BR>var status = 1; <BR>var name = new Array('範鵬','張子涵','代天明','孫季','孫磊','王鴻罡','曾凡丁','李歡','朱穎','王莎','鄭琳琳','朱振家','金一','李成龍','苟超','吳桐','梁良','劉俊'); <br><br>function getname(){ <BR>return name[Math.floor(Math.random()*name.length)]; <BR>} <BR>function showname(){ <BR>document.getElementById("name ").innerHTML = getname(); <BR>setTimeout("showname",200); <BR>} <BR>function goname(){ <BR>intimer = setInterval(showname, 200); <BR>} <BR>} <BR>} <BR>} <BR>} <BR>} <BR>} <BR>} <BR>} <BR>} <BR>} <BR>} <BR>} <BR>} <BR>} <BR>} <BR>function stopname(){ <BR>if(status == 1){ <BR>clearInterval(intimer); <BR>status = 0; <BR>}else{ <BR>intimer = setInterval(showname, 2000) ; <BR>status = 1; <BR>} <BR>} <BR></script> <br><style> <BR>#name{ <BR>border:1px solid #000; </style> </div>margin: auto; font-size:36px; color:#000000; width:108px; height:1em; cursor:pointer; text-align:center } <div id="name" onclick="stopname()"> div> </div>