中文(繁体)
<style type="text/css"><!-- .LoadBarDiv { BORDER-RIGHT: #777 1px dotted; BORDER-TOP: #777 1px dotted; DISPLAY: block; FONT-WEIGHT: normal; FONT-SIZE: 12pxx ; FILTER: Alpha(Opacity=80, FinishOpacity=10, Style=1, StartX=1, StartY=1, FinishX=1, FinishY=100); ; LEFT: expression ((this.parentElement.offsetWidth-this.offsetWidth) /2); VERTICAL-ALIGN: middle; BORDER-LEFT: #777 1px dotted; WIDTH: 250px; WORD-BREAK: break-all; BORDER-BOTTOM: #777 1px dotted; FONT-FAMILY: "?", " Arial", "Helvetica", "sans-serif"; POSITION: absolute; HEIGHT: 78px; BACKGROUND-COLOR: #f1f1f1 } --></style> <script language="JavaScript"> //¤¤¤¤ ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤歡迎下載研究^謝謝¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤想必很稀飯這個效果吧^^我可是做了很久的哦~ 嗯!眼光8錯的說~~ // 把此函數直接引用在網頁中就可以了記得前面要加載它的css樣式哦不懂的可以問我的說~~ // == Page LoadBar == //:: Version.0.4 //:: Powered by Snow :: @ 2006.4.4 //:: QQ:49054026 :: //:: Mail: snow@xunuo.com :: //¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤ ¤¤¤¤¤¤¤¤¤¤¤¤ //+(長寬相容性函數)+-------------------------- ------------------|| function scrollTop() //瀏覽器捲軸位置{ var scrollTop; if (document.documentElement && document.documentElement.scrollTop){ scrollTop = document. documentElement.scrollTop; }else if (document.body){ scrollTop = document.body.scrollTop; }else if (window.pageYOffset){ scrollTop = window.pageYOffset; } return scrollTop; } //函數,相容於IE6&MF by nokersang * function scrollX(){ if(document.documentElement.clientWidth<document.body.clientWidth&&document.documentElement.clientWidth){ theX = 'document.doc&document.documentElement.clientWidth){ theX = 'document.documentElement.cli.Widument'); .clientWidth'; } if(document.documentElement.clientHeight<=document.body.clientHeight&&document.documentElement.clientHeight){ theY = 'document.documentElement.clientHeight'; }else{ theY = 'document). //scrollX(); //------------------------------------------ -------------|| //+(配置函數)+--------------------------- ----------------|| function LoadBar_setvalue(){ LoadBar_Div = document.getElementById('LoadBar'); LoadBar_Msg = document.getElementById("LoadBar_Message"); LoadBar_Top = 250; LoadBar_Div .style.top = LoadBar_Div.offsetTop + LoadBar_Top; LoadBar_Div.filters.alpha.opacity = 50; LoadBar_Delta = 0.05; LoadBar_breathstep = 1; LoadBar_hide_down_y_increase = 50. ; LoadBar_hide_startalpha = 70; } //-- -------------------------------------------------- ---|| //+(放置LoadBar)+------------------------------------- --|| function LoadBar_writebar(){ document.writeln("<div>"); document.writeln("<div id="LoadBar" class="LoadBarDiv">"); document.writeln(" <div id="LoadBar_Message" align="center">"); document.writeln("<br>測試LoadBar<br />中間LoadBar_Div <br /> Made by Snow <br /> [url]www.xunuo.com[/url] <br />"); document.writeln(" <font id=dot color=blue></font>"); document.writeln("</ div>"); document.writeln("</div>"); document.writeln("</div>"); } //---------------- ---------------------------------------|| //+(跟隨捲軸滾動) +------------------------------------|| function LoadBar_move() { if (LoadBar_Div.offsetTop != (scrollTop() + LoadBar_Top)) { var dy = (scrollTop() + LoadBar_Top - LoadBar_Div.offsetTop) * LoadBar_Delta; dy = (dy > 0 ? 1 : - 1) * Math.ceil(Math.absdydy )); LoadBar_Div.style.top = LoadBar_Div.offsetTop + dy; } /* 注意..可能還沒偏移就停止偏移了...因為LoadBar_SetIV函數clearInterval了LoadBar_move if(LoadBar_Div.offsetLeft!=Math. round((eval(theX)-752)*0.25-50)){ var dx=((eval(theX)-752)*0.25-100-LoadBar_Div.offsetLeft) * LoadBar_Delta; dx=(dx>0?1: -1)*Math.ceil(Math.abs(dx)); LoadBar_Div.style.left=LoadBar_Div.offsetLeft+dx+"px"; } */ } //------------- ------------------------------------------|| //+(LoadBar的漸顯函數)+----------------------------------|| var LoadBar_breath_b = 0,LoadBar_breath_c = true; function LoadBar_breath() { var n = LoadBar_breathstep,b = LoadBar_breath_b,c = LoadBar_breath_c; if(b>=90) {c = false;} if(c == false) {b-=n;} if(b<=;} if(b<= 10) {c = true;} if(c == true) {b+=n;} LoadBar_Div.filters.alpha.opacity=b; LoadBar_breath_b = b; LoadBar_breath_c = c; } //-------- -----------------------------------------------|| / /+(LoadBar的閃人函數)+----------------------------------|| var hide_upturn=false ; var hide_upturnnow = false; function LoadBar_Hide() { clearInterval(IV_LoadBar_move); clearInterval(IV_LoadBar_breath); LoadBar_Msg.innerHTML="<br><font color=red>載入完畢6 >測試中..^_^<br>[url]www.xunuo.com[/url] </font>"; if(hide_upturn == false) { LoadBar_Div.filters.alpha.opacity = LoadBar_hide_startalpha; var dy = (scrollTop() + LoadBar_Top + LoadBar_hide_down_y_increase - LoadBar_Div.offsetTop) * LoadBar_Hide_downDelta; dy = (dy > 0 ? 1 : - 1) * Math.ceil(Math.abs(dydyDiv.Baradtop_D. + dy; if(dy <= 0) { hide_upturn = true; } } if(hide_upturn == true) { //意猶未盡~~ 還要移動一下先到屏幕最中央再給你看//上面的因為開始執行國move函數所以有最新滾動條座標if (LoadBar_Div.offsetTop != (scrollTop() + LoadBar_Top) && hide_upturnnow != true) { var dy = (scrollTop() + LoadBar_Top - LoadBar_Div.Div. dy > 0 ? 1 : - 1) * Math.ceil(Math.abs(dy)); LoadBar_Div.style.top = LoadBar_Div.offsetTop + dy; if(LoadBar_Div.offsetTop == (scrollTop() + LoadBar_Top)){ hide_upturnnow = true;} }else{ var dy = (scrollTop() - LoadBar_Div.offsetTop) * LoadBar_Hide_upDelta; dy = Math.ceil(Math.abs(dy)); LoadBar_Div.Barstyle.top = Loadiv_Div.Dv .filters.alpha.opacity = LoadBar_Div.filters.alpha.opacity-2; if(LoadBar_Div.filters.alpha.opacity <= 0) { clearInterval(IV_LoadBar_Hide); LoadBar_Div.style.display = "none"; } } //------------------------------------------------ -------|| //+(放置Interval)+--------------------------------- ------|| function LoadBar_SetIV(start){ if(start == "before onload"){ IV_LoadBar_move = setInterval("LoadBar_move()",20); IV_LoadBar_breath = setInterval("LoadBar_breath()",20) ; } else if (start == "after onload") { clearInterval(IV_LoadBar_move); clearInterval(IV_LoadBar_breath); IV_LoadBar_Hide = setInterval("LoadBar_Hide()",15); } } //--------- ----------------------------------------------|| // +(出來吧~^^)+----------------------------------------- -|| function LoadBar_Start(){ LoadBar_writebar(); LoadBar_setvalue(); LoadBar_SetIV("before onload"); } //----------------------- --------------------------------|| //+(該走了~^^)+---- --------------------------------------|| function LoadBar_End(){ LoadBar_SetIV("after onload "); } //-------------------------------------------------------- -----------|| //+(初始化~^^)+--------------------------- ---------------|| LoadBar_Start();//Start~~~ //匿名函式解決onload只能加函式名稱的問題window.attachEvent('onload',LoadBar_End) ; //----------------------------------------------- --------|| //¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤ ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤ //請保留著作權這樣我會很happy的^^ 3Q!~!^^ 留個我的站點地址備份吧~~常來喔~~ / /{ :: + 許諾| SnoW + ::} //http://www.xunuo.com //:: 找我玩魔獸? :: //:: QQ:49054026 :: //¤¤¤¤¤ ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤ script> <body> 看看效果吧</body></html>