淡入淡出的文本效果
// set your messages. Add as many as you like (you may add additional HTML-tags) var text=new Array() text[0]="歡迎建站學習網(wǎng)" text[1]="這里有您需要的特效代碼." text[2]="讓您的網(wǎng)站更精彩"
// set the corresponding links // If you don't want to link a message just add a "#" instead of an URL var textlink=new Array() textlink[0]="http://3915.net" textlink[1]="http://3915.net/" textlink[2]="http://3915.net/"
// set the corresponding targets // Acceptable values are "_blank", "_self", "_top" or the name of any frame var texttarget=new Array() texttarget[0]="_blank" texttarget[1]="_self" texttarget[2]="_top"
// set the font of the messages var textfont="Arial"
// set the font-color of the messages var textfontcolor="#FFFFFF"
// set the rollover-fontcolor of the messages var textfontcolorrollover="#FF0000"
// set the font-size of the messages (CSS-values) var textfontsize=9
// set the font-size for Netscape 4x (HTML-values) var textfontsizeHTML=2
// set the font backgroundcolor of the textbox var textbgcolor="#000000"
// set the textweight (normal or bold) var textweight="nomal"
// set the fontstyle (normal or italic) var textitalic="normal"
// set the width of the textbox (pixels) var textwidth=240
// set the height of the textbox (pixels) var textheight=60
// set the pause (seconds) var textpause=2
// set the width of the border var textborder=2
// set the color of the border var textbordercolor="#FF0000"
// set the horizontal alignment of the messages (center, left, right) var textalign="center"
// set the vertival alignment of the messages (middle, top, bottom) var textvalign="middle"
// do not edit below this line var textdecoration="none" var textweightA="" var textweightB="" var textitalicA="" var textitalicB="" var transparency=100 var transparencystep=2
var x_pos=0 var y_pos=0 var i_text=0 var textsplit="" var i_textsplit=0 var i_mark=0 var tickercontent var pausefade=30 textpause*=1000
var oneloopfinished=false
var browserinfos=navigator.userAgent var ie=document.all&&!browserinfos.match(/Opera/) var ns4=document.layers var ns6=document.getElementById&&!document.all&&!browserinfos.match(/Opera/) var opera=browserinfos.match(/Opera/) var browserok=ie||ns4||ns6||opera
function changecontent() { getcontent() i_text++ if (i_text>=text.length) {i_text=0} if (ie) { ticker.innerHTML=content fadeout() } if (opera || ns6) { document.getElementById('ticker').innerHTML=content var texttimer=setTimeout("changecontent()",2*textpause) } if (ns4) { document.roof.document.ticker.document.write(content) document.roof.document.ticker.document.close() var texttimer=setTimeout("changecontent()",textpause) } }
function fadein() { if (transparency<100){ transparency+=transparencystep if (ie) { document.all.tickerbg.filters.alpha.opacity=transparency } var fadetimer=setTimeout("fadein()",pausefade) } else { clearTimeout(fadetimer) setTimeout("changecontent()",1000) } }
function fadeout() { if (transparency>0){ transparency-=transparencystep if (ie) { document.all.tickerbg.filters.alpha.opacity=transparency } if (ns6) { document.getElementById('tickerbg').style.MozOpacity=transparency/100 } var fadetimer=setTimeout("fadeout()",pausefade) } else { clearTimeout(fadetimer) setTimeout("fadein()",textpause) } }
getcontent() function getcontent() { if (ie || opera) { var tablewidth=textwidth-2*textborder var tableheight=textheight-2*textborder } else { var tablewidth=textwidth |