歡迎進入紅數信息技術有限公司官網
4008088160
現在的位置:首頁 > 發布網絡推廣公司-營銷推廣 > 做好幻燈片式的導航菜單
做好幻燈片式的導航菜單
信息來源:湖南優度網絡公司  發布日期:2011/3/8 瀏覽數量:948
文章導讀: ...

如何做好幻燈片式的導航菜單,下面就是做導航菜單的代碼:

<style>
#linkView{
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>
</head>
<body bgcolor="#fef4d9" onload="if (document.all||document.layers) {regenerate2();update()}">
<div id="linkView">
<div id="subtickertape" class="subtickertapefont">初始化...</div>
</div>
<script language="JavaScript">
//默認速度3秒,可以修改速度快慢。
var speed=3000
var news=new Array()
news[0]="<a href='index1.htm'>我的連接1</a>"http://創建鏈接樹數組
news[1]="<a href='index2.htm'>我的連接2</a>"
news[2]="<a href='index3.htm'>我的連接3</a>"
news[3]="<a href='index4.htm'>我的連接4</a>"
news[4]="<a href='index5.htm'>我的連接5</a>"
news[5]="<a href='index6.htm'>我的連接6</a>"
news[6]="<a href='index7.htm'>我的連接7</a>"

//顯示的信息內容按照格式添加。
i=0
if (document.all)
tickerobject=document.all.subtickertape.style
else
tickerobject=document.linkView.document
function regenerate(){
window.location.reload()        //重新加載頁面
}
function regenerate2(){
if (document.layers)           //非ie瀏覽器時的定時器
setTimeout("window.onresize=regenerate",450)
}

function update(){
 BgFade(0xff,0xff,0xff, 0x00,0x00,0x00,10);
if (document.layers){
document.linkView.document.subtickertape.document.write('<span class="subtickertapefont">'+news[i]+'</span>')
document.linkView.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>
</body>
</html>

18973218026
其他業務合作請發下面郵箱
郵箱:254596208@qq.com
地址:湖南省湘潭市岳塘區霞光東路58號(維也納酒店6樓)
營銷型網站建設掃一掃關注官方微信

關注優度

官方微信
官方微博
官網首頁