中文(繁体)
<!-- 要完成這個效果需要兩個步驟 第一步:把如下程式碼加入<head>區域中--> <SCRIPT LANGUAGE="JavaScript"> <!-- Begin function mklist(n) { this.長度=n; for (var c=1 ; c <= n ; c++) { this[c]=0;返回這個; } 函數 browserdelay() { var retval=500; if (navigator.userAgent.indexOf("Win") != 0) { retval=150; } else if (navigator.userAgent.indexOf("Mac") != 0) { retval=500; } else if (navigator.userAgent.indexOf("X11") != 0) { retval=750;返回retval; } 函數 mkcfg(n) { this.num=1;這個.seed=0; this.list=new mklist(n); this.type=new mklist(n); this.delay=瀏覽器延遲(); this.timer=0; this.showurl=(5 * 1000); this.looping=true; this.msgdisp=(4 * 1000); this.barwidth=100;返回這個; } 函數 urlfix(obj) { window.clearTimeout(window.config.timer); window.defaultStatus=obj.href; window.config.timer=window.setTimeout("sbprint()",window.config.showurl);返回真; } 函數scrollit_r2l() { var out=" "; var c = 0; if (window.config.seed <= window.config.barwidth && window.config.seed > 0) { for (c=0 ; c < window.config.seed ; c++) { out+=" "; } } out+=window.config.list[window.config.num]; window.config.seed--;視窗狀態=輸出; window.config.timer=window.setTimeout("scrollit_r2l()",window.config.delay); } else if (window.config.seed <= 0) { if (-window.config.seed < window.config.list[window.config.num].length) { out+=window.config.list[window.config .num].substring(-window.config.seed,window.config.list[window.config.num].length); window.config.seed--;視窗狀態=輸出; window.config.timer=window.setTimeout("scrollit_r2l()",window.config.delay); } else { window.status =“”; window.config.num++; window.config.timer=window.setTimeout("sbprint()",window.config.msgdisp); window.config=new mkcfg(7); } } } window.config=new mkcfg(7); window.config.list[1]="這裡改寫你的第一則訊息"; window.config.type[1]=0; window.config.list[2]="這裡改寫你的第二個訊息"; window.config.type[2]=0; window.config.list[3]="這裡改寫你的第三個訊息"; window.config.type[3]=0; window.config.list[4]="這裡改寫你的第四則訊息"; window.config.type[4]=0; window.config.list[5]="這裡改寫你的第五則訊息"; window.config.type[5]=0; window.config.list[6]="這裡改寫你的第六個訊息"; window.config.type[6]=0; window.config.list[7]="這裡改寫你的第七封訊息"; window.config.type[7]=0;函數 sbprint() { if (window.config.num <= window.config.list.length) { if (window.config.type[window.config.num] == 0) { window.status=window.config.列表[視窗.config.num]; window.config.num++; window.clearTimeout(window.config.timer); window.config.timer=window.setTimeout('sbprint()',window.config.msgdisp); } else if (window.config.type[window.config.num] == 1) { window.config.seed=window.config.barwidth;滾動它_r2l(); } } else if (window.config.looping) { window.config.num=1; window.clearTimeout(window.config.timer); window.config.timer=window.setTimeout('sbprint()',window.config.delay); } } // 結束 --> </script> <!--第二步:把“onload="window.config.timer=window.setTimeout('sbprint()',window.config.delay);"”加在<body>區域--> <body onload="window.config.timer=window.setTimeout('sbprint()',window.config.delay);">