打印本文 打印本文 关闭窗口 关闭窗口
页面特效很靓的导航
作者:武汉SEO闵涛  文章来源:敏韬网  点击数838  更新时间:2009/4/23 11:15:01  文章录入:mintao  责任编辑:mintao

说明: 很靓的导航

效果: 运行后查看!

代码: 在<head>与</head>之间插入如下代码:


[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]

在<body>区插入如下代码: <div id="tickertape">
<div id="subtickertape" class="subtickertapefont">初始化...</div>
</div>
<script language="JavaScript1.2">

//默认速度4.5秒,自己修改速度快慢。
var speed=4500

var news=new Array()
news[0]="<a href='http://www.ntc.com.cn/webpage/index.html'>1 网页制作</a>"
news[1]="<a href='http://www.ntc.com.cn/js/index.html'>2 网页特效</a>"
news[2]="<a href='http://www.ntc.com.cn/graphics/index.html'>3 图像处理</a>"
news[3]="<a href='http://www.ntc.com.cn/flash/index.html'>4 Flash</a>"
news[4]="<a href='http://www.ntc.com.cn/news/'>5 新闻链接</a>"
news[5]="<a href='http://www.ntc.com.cn/coolsite.htm'>6 站点导航</a>"
news[6]="<a href='http://www.ntc.com.cn/soundcode/'>7 软件下载</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++;
}




打印本文 打印本文 关闭窗口 关闭窗口