加入收藏 - 网站地图 - 网站搜索 -
阅读新闻

定时更换的超酷连接

[日期:01-19] 来源:  作者: [字体: ]

<html>
<head>
<title>网页特效|Linkweb.cn/Js|---定时更换的超酷连接</title>
</head>
<body onload="if (document.all||document.layers) {regenerate2();update()}">
<!--用<body onload="if (document.all||document.layers) {regenerate2();update()}">替换原来的<Body>-->
<!--将以下代码加入HTML的<Body></Body>之间-->

<style>
<!--

#tickertape{
position:relative;

layer-background-color:black;
width:400;
height:12;
; font-family: "宋体"; font-size: 9pt}

#subtickertape{
background-color:black;
position:absolute;
border: 1px solid black;
width:400;
height:12;
; font-family: "宋体"; font-size: 9pt
}


.subtickertapefont{
font:bold 9pt "宋体";
text-decoration:none;
color:white;
}

.subtickertapefont a{
color:white;
text-decoration:none;
; font-family: "宋体"; font-size: 9pt}
-->
</style>
<div id="tickertape">
<div id="subtickertape" class="subtickertapefont">初始化...</div>
</div>
<script language="JavaScript1.2">

var speed=2500

var news=new Array()
news[0]="<a href='#'>网页特效</a>"
news[1]="<a href='#'>资源文章</a>"
news[2]="<a href='#'>源码下载</a>"
news[3]="<a href='#'>教程学习</a>"
news[4]="<a href='#'>平面设计</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>
</tr></table>
</body></html>



评论 】 【 推荐 】 【 打印
上一篇:链接驱动背景色
下一篇:飘忽不定的图片链接
相关新闻       特效代码