語法展示::  http://home.graffiti.net/ppofhgfhfdx/


請用IE6.0或更新版本觀看語法特效展示


將以下程式碼複製,貼在<head>及</head>標籤之間。

<style>
<!--
#tickertape{position:relative;width:60}
#subtickertape{position:absolute;border: 1px solid black;width:400}
.subtickertapefont a{color:#FFFFFF;text-decoration:none}
-->
</style>


#tickertape{position:relative;width:60} 中修改特效距離視窗左方的位置
#subtickertape{position:absolute;border: 1px solid black;width:400} 中修改特效的寬度
.subtickertapefont a{color:#FFFFFF;text-decoration:none} 中修改連結的顏色



將以下程式碼複製,貼在<body >標籤裡面。

 onload="if (document.all||document.layers) {regenerate2();update()}"


將以下程式碼複製,貼在<body>及</body>標籤之間。


<div id="tickertape" align="center">
<div id="subtickertape" class="subtickertapefont" align="center">初始化......</div>
</div>
<script language="JavaScript1.2">
<!--
var speed=5000
var news=new Array()
news[0]="<a href='http://tw.yahoo.com/' target='_blank'>奇摩</a>"
news[1]="<a href='http://chinese.yahoo.com/' target='_blank'>雅虎</a>"
news[2]="<a href='http://www.yam.com/' target='_blank'>蕃薯藤</a>"
news[3]="<a href='http://www.sina.com.tw/' target='_blank'>新浪網</a>"
news[4]="<a href='http://www.pchome.com.tw/' target='_blank'>PC home</a>"
news[5]="<a href='http://cdh.idv.tw' target='_blank'>爪哇島</a>"
i=0
if (document.all)
tickerobject=document.all.subtickertape.style
else
tickerobject=document.tickertape.document
function regenerate(){
window.location.reload()
}
function regenerate2(){
if (document.layers)
setTimeout("window.onresize=regenerate",450)
}
function update(){
 BgFade(0xff,0xff,0xff, 0x00,0x00,0x00,10);
if (document.layers){
document.tickertape.document.subtickertape.document.write('<span class="subtickertapefont">'+news[i]+'</span>')
document.tickertape.document.subtickertape.document.close()
}
else
document.all.subtickertape.innerHTML=news[i]
if (i<news.length-1)
i++
else
i=0
setTimeout("update()",speed)
}
 function BgFade(red1, grn1, blu1, red2,
 grn2, blu2, steps) {
 sred = red1; sgrn = grn1; sblu = blu1;
 ered = red2; egrn = grn2; eblu = blu2;
 inc = steps;
 step = 0;
 RunFader();
 }
 function RunFader() {
 var epct = step/inc;
 var spct = 1 - epct;
 if (document.layers)
 tickerobject.bgColor =
 Math.floor(sred * spct + ered *
 epct)*256*256 +
 Math.floor(sgrn * spct + egrn * epct)*256 +
 Math.floor(sblu * spct + eblu * epct);
 else
 tickerobject.backgroundColor=
 Math.floor(sred * spct + ered *
 epct)*256*256 +
 Math.floor(sgrn * spct + egrn * epct)*256 +
 Math.floor(sblu * spct + eblu * epct);
 if ( step < inc ) {
 setTimeout('RunFader()',50);
 }
 step++;
 }
-->
</script>

var speed=5000 中修改變化的時間(每1秒=1000)
自行增減連結的數量及路徑

arrow
arrow
    全站熱搜

    uuiop6623 發表在 痞客邦 留言(0) 人氣()