語法展示:: http://home.graffiti.net/ewffghy/
請用IE6.0或更新版本觀看語法特效展示
將以下程式碼複製,貼在<body>及</body>標籤之間。
<center>
<script language="Javascript1.2">
<!--
var tags_before_clock = "<big><center>";
var tags_after_clock = "</big></center>";
var speed = 100;
var speed2 = 5000;
var mymessage = new Array
(
"歡迎光臨 爪哇島",
"這個跑馬燈沒有外框",
"而且不需要什麼設定",
"假如您需要增加訊息數量",
"只要用兩個引號將訊息包住",
"後面再加個逗點即可"
);
var mymessage2 = mymessage;
var x = 0;
var y = 0;
if(navigator.appName == "Netscape")
{
document.write('<layer id="ticker"></layer><br>');
}
if (navigator.appVersion.indexOf("MSIE") != -1)
{
document.write('<span id="ticker"></span><br>');
}
function upticker()
{
if (y > mymessage2.length - 1)
{
y = 0;
setTimeout("upticker()",speed);
}
else
{
if (x > mymessage2[y].length)
{
mymessage = mymessage2[y];
x = 0; y++;
setTimeout("upticker()",speed2);
}
else
{
mymessage = mymessage2[y].substring(0,x++);
setTimeout("upticker()",speed);
}
if(navigator.appName == "Netscape")
{
document.ticker.document.write(tags_before_clock+mymessage+tags_after_clock);
document.ticker.document.close();
}
if (navigator.appVersion.indexOf("MSIE") != -1)
{
ticker.innerHTML = tags_before_clock+mymessage+tags_after_clock;
}
}
}
setTimeout("upticker()",speed);
-->
</script>
</center>在 var speed = 100; 中修改訊息的速度 在 var speed2 = 5000; 中修改間隔的時間(每1秒=1000)
留言列表