語法展示:: http://home.graffiti.net/plbbgfr/
在 var speed = 100; 中修改訊息的速度 在 var speed2 = 2000; 中修改每個動作間停滯的時間(每1秒=1000) 在 var biggest_text = 20; 中修改最大時的字體大小
請用IE6.0或更新版本觀看語法特效展示
將以下程式碼複製,貼在<body>及</body>標籤之間。
<center>
<script language="Javascript1.2">
<!--
var tags_before_clock = "<center>";
var tags_after_clock = "</center>";
var speed = 100;
var speed2 = 2000;
var biggest_text = 20;
var x = 0;
var y = 0;
var themessage, size;
var esize = "</font>";
var themessage2 = new Array
(
"這個跑馬燈沒有外框",
"而且不需要什麼設定",
"假如您需要增加訊息數量",
"只要用兩個引號將訊息包住",
"後面再加個逗點即可"
);
if(navigator.appName == "Netscape") {
document.write('<layer id="wds"></layer><br>');
}
if (navigator.appVersion.indexOf("MSIE") != -1){
document.write('<span id="wds"></span><br>');
}
function upwords()
{
themessage = themessage2[y];
if (x < biggest_text)
{
x++;
setTimeout("upwords()",speed);
}
else
{
setTimeout("downwords()",speed2);
}
if(navigator.appName == "Netscape")
{
size = "<font point-size='"+x+"pt'>";
document.wds.document.write(size+tags_before_clock+themessage
+tags_after_clock+esize);
document.wds.document.close();
}
if (navigator.appVersion.indexOf("MSIE") != -1)
{
wds.innerHTML = tags_before_clock+themessage+tags_after_clock;
wds.style.fontSize=x+'px'
}
}
function downwords()
{
if (x > 1)
{
x--;
setTimeout("downwords()",speed);
}
else
{
setTimeout("upwords()",speed2);
y++;
if (y > themessage2.length - 1) y = 0;
}
if(navigator.appName == "Netscape")
{
size = "<font point-size='"+x+"pt'>";
document.wds.document.write(size+tags_before_clock+themessage
+tags_after_clock+esize);
document.wds.document.close();
}
if (navigator.appVersion.indexOf("MSIE") != -1)
{
wds.innerHTML = tags_before_clock+themessage+tags_after_clock;
wds.style.fontSize=x+'px'
}
}
setTimeout("upwords()",speed);
-->
</script>
</center>
留言列表