蛙 14-5-2012 16:27
隨機選擇按鈕
<FONT color=blue>
<P><FONT color=#0000ff size=3>如不能顯示語法效果可貼去本站</FONT><A href="http://www.bunbun000.com/html/index.htm" target=_blank><FONT color=red size=3>語法測試板</FONT></A><FONT color=#0000ff size=3>試看</FONT></P></FONT>
<P><FONT color=blue></FONT> </P>
<P><FONT color=blue></FONT> </P>
<P><FONT color=blue></FONT> </P>
<P><FONT color=blue></FONT> </P>
<P><FONT color=blue><script><BR>var count=0<BR>function dothis(){<BR>setTimeout("document.wheel.wheel2.selectedIndex =1000",100)<BR>setTimeout("document.wheel.wheel2.selectedIndex =count",200)<BR>setTimeout("document.wheel.wheel2.selectedIndex =1000",300)<BR>setTimeout("document.wheel.wheel2.selectedIndex =count",400)<BR>setTimeout("document.wheel.wheel2.selectedIndex =1000",500)<BR>setTimeout("document.wheel.wheel2.selectedIndex =count",600)<BR>setTimeout("window.location=document.wheel.wheel2.options[document.wheel.wheel2.selectedIndex].value",800)<BR>}</FONT></P>
<P><FONT color=blue>function animate(){<BR>var countfinal=Math.round(Math.random()*(document.wheel.wheel2.length-1))<BR>document.wheel.wheel2.selectedIndex =count<BR>if (count==countfinal){<BR>dothis()<BR>return<BR>}<BR>if (count<document.wheel.wheel2.length)<BR>count++<BR>else<BR>count=0<BR>setTimeout("animate()",50)<BR>} </FONT></P>
<P><FONT color=blue></script></FONT></P>
<P><FONT color=blue><form method="POST" name="wheel"></FONT></P>
<P><FONT color=blue> <div align="center"><center><p><select name="wheel2" size="6"><BR> <option value="</FONT><A href="http://bunbun000.com/"><FONT color=blue>http://bunbun000.com/</FONT></A><FONT color=blue>">笨笨網站</option><BR> <option value="</FONT><A href="http://www.bunbunhk.com/BBS/Discuz/index.php"><FONT color=blue>http://www.bunbunhk.com/BBS/Discuz/index.php</FONT></A><FONT color=blue>">笨網論壇</option><BR> <option value="</FONT><A href="http://bunbun000.com/home/word/index.htm"><FONT color=blue>http://bunbun000.com/home/word/index.htm</FONT></A><FONT color=blue>">繁簡轉換</option><BR> <option value="</FONT><A href="http://bunbun000.com/home/js.htm"><FONT color=blue>http://bunbun000.com/home/js.htm</FONT></A><FONT color=blue>">翻譯系統</option><BR> <option value="</FONT><A href="http://bunbun000.com/home/travel/index.htm"><FONT color=blue>http://bunbun000.com/home/travel/index.htm</FONT></A><FONT color=blue>">笨笨遊蹤</option><BR> <option value="</FONT><A href="http://www.bunbunhk.com/bg.htm"><FONT color=blue>http://www.bunbunhk.com/bg.htm</FONT></A><FONT color=blue>">免費資源</option><BR> </select></p><BR> </center></div><div align="center"><center><p><input type="button" value="按掣隨選"<BR> name="B1" onClick="animate()"></p><BR> </center></div><BR></form></FONT></P>
蛙 25-4-2013 13:16
複製上列語法
<form name="copy">
<textarea cols="40" name="txt" rows="4" style="BACKGROUND-COLOR:#ffffff; COLOR:#000000; FONT-SIZE:9pt">
<script>
var count=0
function dothis(){
setTimeout("document.wheel.wheel2.selectedIndex =1000",100)
setTimeout("document.wheel.wheel2.selectedIndex =count",200)
setTimeout("document.wheel.wheel2.selectedIndex =1000",300)
setTimeout("document.wheel.wheel2.selectedIndex =count",400)
setTimeout("document.wheel.wheel2.selectedIndex =1000",500)
setTimeout("document.wheel.wheel2.selectedIndex =count",600)
setTimeout("window.location=document.wheel.wheel2.options[document.wheel.wheel2.selectedIndex].value",800)
}
function animate(){
var countfinal=Math.round(Math.random()*(document.wheel.wheel2.length-1))
document.wheel.wheel2.selectedIndex =count
if (count==countfinal){
dothis()
return
}
if (count<document.wheel.wheel2.length)
count++
else
count=0
setTimeout("animate()",50)
}
</script>
<form method="POST" name="wheel">
<div align="center"><center><p><select name="wheel2" size="6">
<option value="http://bunbun000.com/">笨笨網站</option>
<option value="http://www.bunbunhk.com/BBS/Discuz/index.php">笨網論壇</option>
<option value="http://bunbun000.com/home/word/index.htm">繁簡轉換</option>
<option value="http://bunbun000.com/home/js.htm">翻譯系統</option>
<option value="http://bunbun000.com/home/travel/index.htm">笨笨遊蹤</option>
<option value="http://www.bunbunhk.com/bg.htm">免費資源</option>
</select></p>
</center></div><div align="center"><center><p><input type="button" value="按掣隨選"
name="B1" onClick="animate()"></p>
</center></div>
</form>
</textarea><br>
<input onclick="javascript:this.form.txt.focus();this.form.txt.select();" type="button" value="全選">
</form>
<BR>
<script type="text/javascript"><!--
google_ad_client = "ca-pub-4078143172638881";
/* 336X280 */
google_ad_slot = "3268225205";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>