#1
橫向捲動文字跑馬燈 - 蛙 (Administrator) 發表於 6-7-2013 10:03
var speed = 300 <<< 300是走動速度,越大越慢,可改
萬重山後之留空位,是兩段文字間之分隔,可增加或減少
如不能顯示語法效果可貼去本站語法測試板試看
<script language="Javascript">
<!--
var speed = 300
var message = "朝辭白帝彩雲間,千里江陵一日還。兩岸猿聲啼不住,輕舟已過萬重山。 "
var s = 0
var l = message.length
document.write("<center><form name='btn'><input type='button'"
+"name='sc' value='"+ message +"'></form></center>"
function btnsc() {
document.btn.sc.value = message.substring(s,l) + message.substring(0,s)
s++
if (s >= l) {
s = 0
}
setTimeout("btnsc()",speed)
}
btnsc();
//-->
</script>
#2
複製上列語法 - 蛙 (Administrator) 發表於 6-7-2013 10:07
<form name="copy">
<textarea cols="40" name="txt" rows="4" style="BACKGROUND-COLOR:#ffffff; COLOR:#000000; FONT-SIZE:9pt">
<script language="Javascript">
<!--
var speed = 300
var message = "朝辭白帝彩雲間,千里江陵一日還。兩岸猿聲啼不住,輕舟已過萬重山。 "
var s = 0
var l = message.length
document.write("<center><form name='btn'><input type='button'"
+"name='sc' value='"+ message +"'></form></center>"
function btnsc() {
document.btn.sc.value = message.substring(s,l) + message.substring(0,s)
s++
if (s >= l) {
s = 0
}
setTimeout("btnsc()",speed)
}
btnsc();
//-->
</script>
</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>