中文(繁体)
網頁特效程式碼,又一種簡單的網站新聞頻道圖片切換特效
<STYLE type=text/css> /* 數字按鈕框樣式*/ #imgTitle {FILTER:ALPHA(opacity=70);position:relative;left:0px ;text-align:left;overflow: hidden;} #imgTitle_up {left:0px;text-align: left; height:1px; width:inherit; } #imgTitle_down {left:0px;text-align: right width:inherit; ; } /* 圖片框樣式*/ .imgClass {border: 0px solid #000;} /* 圖片文字框樣式*/ #txtFrom {text-align: center;vertical-align: middle; color:#333333} /*數字按鈕樣式*/ .button {text-decoration: none; float:left; height:12px; line-height:12px; padding-left:7px; padding-right:6px;background: #7B7B63;margin: 0px; : bold 9px sans-serif; border-left:#fff 1px solid;} a.button, a.button:link, a.button:visited {font-family: sans-serif;text-decoration: none;color:#ration: none;color:#ration: none;color:# FFFFFF;background-color: #000000;} a.button:hover {font-family: sans-serif;text-decoration: none;color:#fff;background:#fff; } .buttonDiv {background: #000000;height : 1px;width: 21px;float: left;text-align: center; vertical-align: middle;} /*漸變*/ .trans { width:88px; height:12px; overflow:hidden} </STYLE> <SCTRIPT language=JavaScript type=text/javascript> var imgWidth=165; //圖片寬var imgHeight=200; //圖片高var textFromHeight=21; //焦點字框高度(單位為px) var textStyle="bt_link"; //焦點字class style (不是連接class) var textLinkStyle="FONT"; //焦點字連接class style var buttonLineOn="#ce0609"; //button底線on的顏色var buttonLineOff="#000"; // button下劃線off的顏色var TimeOut=5000; //每張圖切換時間(單位毫秒); var imgUrl=new Array(); var imgLink=new Array(); var imgtext=new Array(); var imgAlt=new Array(); var adNum=0; var theTimer=0; var tt=1; //焦點字框高度樣式表開始document.write('<style type="text/css">'); document.write( '#focuseFrom{width:'+(imgWidth+2)+';margin: 0px; padding:0px;height:'+(imgHeight+textFromHeight)+'px; overflow:hidden;}'); document.write(' #txtFrom{height:'+textFromHeight+'px;line-height:'+textFromHeight+'px;width:'+imgWidth+'px;overflow:hidden;}'); document.write('#imgTitle{width:'+imgWidth:'+imgWidth ';top:-'+(textFromHeight+12)+'px;height:18px}'); document.write('</style>'); document.write('<div id="focuseFrom">') ; //焦點字框高度樣式表結束tt=1; imgUrl[tt] =''; imgtext[tt]=' 07/08羊絨衫設計預測'; imgLink[tt]='http://www .downcodes.com'; imgAlt[tt]='07/08羊絨衫設計預測'; tt=2; imgUrl[tt] =''; imgtext[tt]=' 羊絨衫的色彩藝術'; imgLink[ tt]='http://www.downcodes.com'; imgAlt[tt]='羊絨衫的色彩藝術'; tt=3; imgUrl[tt] =''; imgtext[tt]=' 羊絨衫的新美學主義'; imgLink[tt]='http://www.downcodes.com'; imgAlt[tt]='羊絨衫的新美學主義'; tt=4; imgUrl[tt] =''; imgtext [tt]=' 07/08秋冬女裝羊絨衫'; imgLink[tt]='http://www.downcodes.com'; imgAlt[tt]='07/08秋冬女裝羊絨衫趨勢'; var intPage =0; for (var i=1;i<=imgUrl.length;i++) { if (imgUrl[i]!="!!!") { intPage++; } } function changeimg(n) { adNum=n; window.clearInterval(theTimer); adNum=adNum-1; nextAd(); } function goUrl(){ window.open(imgLink[adNum],'_blank'); } //NetScape開始if (navigator.appName == " Netscape") { document.write('<style type="text/css">'); document.write('.buttonDiv{height:4px;width:21px;}'); document.write('</style >'); function nextAd(){ if(adNum<(intPage-1))adNum++; else adNum=1; theTimer=setTimeout("nextAd()", TimeOut); document.images.imgInit.src=imgUrl[adNum ]; document.images.imgInit.alt=imgAlt[adNum]; document.getElementById('focustext').innerHTML=imgtext[adNum]; document.getElementById('link'+adNum).style.background=buttonLine; document getElementById('imgLink').href=imgLink[adNum]; for (var i=1;i<=intPage;i++) { if (i!=adNum){document.getElementById('link'+i).style. background=buttonLineOff;} } } document.write('<a id="imgLink" href="'+imgLink[1]+'" target=_blank class="p1"><img src="imgUrl[1]" name="imgInit" border=1 alt="'+imgAlt[1]+'" class="imgClass"></a><div id="txtFrom"><span id="focustext" class="'+ textStyle+'">'+imgtext[1]+'</span></div>') document.write('<div id="imgTitle">'); document.write('<div id="imgTitle_down" >'); //數字按鈕程式碼開始for(var i=1;i<intPage;i++){document.write('<a href="javascript:changeimg('+i+')" class="button" style ="cursor:hand" title="'+imgAlt[i]+'">'+i+'</a>');} //數字按鈕碼結束document.write('</div>'); document .write('</div>'); document.write('</div>'); nextAd(); } //NetScape結束//IE開始else { var count=0; for (i=1;i <intPage;i++) { if( (imgUrl[i]!="") && (imgLink[i]!="")&&(imgtext[i]!="")&&(imgAlt[i]!="" ) ) { count++; } else { break; } } function playTran(){ if (document.all) document.images.imgInit.filters.BlendTrans.play(); } var key=0; function nextAd(){ if( adNum<count)adNum++ ; else adNum=1; if( key==0 ){ key=1; } else if (document.all){ //imgInit.filters.revealTrans.Transition=6; document.images.imgInit. filters.BlendTrans.apply(); playTran(); } document.images.imgInit.src= imgUrl[adNum]; document.images.imgInit.alt=imgAlt[adNum]; document.getElementById('link'+adNum). style.background=buttonLineOn; for (var i=1;i<=count;i++) { if (i!=adNum){document.getElementById('link'+i).style.background=buttonLineOff;} } focustext. innerHTML=imgtext[adNum]; //links_ie_font.links=imglink[adNum]; theTimer=setTimeout("nextAd()", TimeOut); } document.write('<a target=_self href="javascript:goUrl() "><img style="FILTER: BlendTrans ( duration=1 );" src="javascript:nextAd()" border=0 vspace="0" name=imgInit class="imgClass"></a>'); document.write('<div id="txtFrom"><a target=_self href="javascript:goUrl()"><span id="focustext" class="'+textStyle+'"></span></ a></div>'); document.write('<div id="imgTitle">'); document.write(' <div id="imgTitle_down"> <a class="trans"" style="float :left"><img src="" border=0></a>'); //數字按鈕程式碼開始for(var i=1;i<intPage;i++){document.write('<a id= "link'+i+'" href="javascript:changeimg('+i+')" class="button" style="cursor:hand" title="'+imgAlt[i]+'" onFocus="this.blur ()">'+i+'</a>');} //數字按鈕碼結束document.write('</div>'); document.write('</div>'); document.write( '</div>'); changeimg(1); } //IE結束</SCRIPT>