中文(繁体)
<!-- http://bbs.downcodes.com--> <!-- 完成此效果需要把下面程式碼放置<body>區域中--> <divalign="center"> <SCRIPT language=JavaScript > < !-- //------------------------ 啟動自訂變數----------------- ------// //===定位===// var left = 100; // 起始左側位置 var top = 20; // 起始左側位置 //=== 曲線與距離 ===// var topInc = 5; // 頂部位置增量 var leftInc = 5; // 左側位置遞增 /* 使水平曲線和垂直曲線相同,以.. .. 獲得沒有曲線的不斷增加的間隙。 */ var hor_curve = 20; // 水平曲線 - 0 表示無曲線 var ver_curve = -20; // 垂直曲線 - 0 表示無曲線 //=== 計時和其他 ===// var noTimes = 50; // 圖片顯示的次數 var waitTime = 1; // 時間延遲 var layer = 2; // 圖層等級 var picture = '/images/logo.gif'; // 要顯示的圖片(圖片越小效果越好) var start_retracted= true; // 啟動映像縮回(true / false) vartract= true; // 展開後從後面縮回 (true / false) //=== 淡入淡出選項 (僅 IE 使用者可以看到淡入淡出) ===// var fade = true; // 逐漸淡入淡出 (true / false) - 僅在撤回 =true 時有效 var fd_destop = 0; // 目標透明度等級(即 80,對於大部分固體) var fd_rate = 10; // 透明度變更之間的時間(以毫秒為單位)(最好低於 100) var fd_delta = 5; // 每次變化量(即 5,透明度變化 5%) var event_init = 'onClick'; // 啟動腳本的事件 var left_formula = '(left + leftInc) + ((count/100) * hor_curve)'; // 左側位置公式 var top_formula = '(top + topInc) + ((count/100) * ver_curve)'; // 頂部位置公式//------------------------------------ 結束自訂變數--- -------------- ------// //--------------------- 不要編輯超出此點! ----------------------------------// var 計數 = 0; var count2 = 0; var timeOutVal = 等待時間 * 10; var txt;變數影像; var 圖片名稱; varlay = 新數組;函數 addLayer(){ left = eval(left_formula);頂部 = eval(top_formula); txt = "<div id='圖層" + count + "' style='位置:絕對; 可見性:隱藏; 左:" + 左+ "; 頂部:" + 頂部+ "; z 索引:" + 圖層 + “'>”; txt += "<a href='#' " + event_init + "='replay()'><img src='" + picture + "' border=0 style='filter:alpha(opacity=100)' 名稱= '圖像" + 計數+ "'></a>"; txt += "</div>";文檔.write(txt); lay[count]=new lib_obj("圖層"+count); } 函數 logoCurveInit(){ while (count < noTimes) { addLayer();計數++; } 計數 = 0;放置[0].showIt(); if (!start_retracted) animate(); } 函數 animate(){ if (start_retracted) { if (!retract){ if (count > 0){ setTimeout('animate()',timeOutVal); }放置[計數].hideIt();數數 - ; } } else{ if (count >= 0){ setTimeout('animate()',timeOutVal);放置[計數].showIt(); if (count != 0) fadeImage();數數 - ; } } 如果(收回){ if(count==0)retractIt(); } } else{ if (count < noTimes){ setTimeout('animate()',timeOutVal);放置[計數].showIt(); if (count != noTimes-1 &&撤回) fadeImage();計數++; } if (retract){ if (count == noTimes) receiveIt(); } } } function replay(){ if ((count == noTimes || (count == 0 || count == -1)) &&(count2 == noTimes-1 || count2 == 0)){ start_retracted = !start_retracted; // 使值與實際值相反 make_all_visible(); if (start_retracted){ 計數 = noTimes-1; } 否則 { 計數 = 0; } 動畫(); } } functiontractIt(){ if (start_retracted) { // 如果標誌未縮回(顯示所有圖層) if (count2 > 0){ setTimeout('retractIt()',timeOutVal);放置[count2].hideIt();計數2——; } } else{ // 如果標誌被收回(只顯示第一層) if (count2 < noTimes-1){ setTimeout('retractIt()',timeOutVal);放置[count2].hideIt();計數2++; } } } function fadeImage(){ if (fade){ if (count >= 0 && count <= noTimes){ image = document.images['Image' + count]; nereidFade(圖像,fd_destop,fd_rate,fd_delta); } } } function make_all_visible(){ for (var i = 0; i< noTimes ; i++){ if (document.images['Image' + i].style.MozOpacity){ document.images['Image' + i] .style.MozOpacity=100; } else if (document.images['Image' + i].filters) { document.images['Image' + i].filters.alpha.opacity = 100; } } } ////****************(DHTMLCentral.com)****************//// 函數check_browser ( ){ this.ver=navigator.appVersion this.agent=navigator.userAgent this.dom=document.getElementById?1:0 this.opera5=this.agent.indexOf("Opera 5")>-1 this.ie5=this.agent.indexOf("Opera 5")>-1 this.ie5= ( this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0; this.ie4=(document.all && !this.dom && !this.opera5)?1:0; this.ie=this.ie4||this.ie5||this.ie6 this.mac=this.agent.indexOf("Mac")>-1 this.ns6=(this.dom && parseInt(this.ver) > = 5) ?1:0; this.ns4=(document.layers && !this.dom)?1:0; this.bw=(this.ie6||this.ie5||this.ie4||this.ns4||this.ns6||this.opera5) 回傳這個 } bw=new check_browser() function show_message(txt){alert (TXT); return false} function lib_obj(obj,nest){ if(!bw.bw) return show_message('舊瀏覽器') Nest=(!nest) ? "":'文檔.'+nest+'.' this.evnt=bw.dom? document.getElementById(obj): bw.ie4?document.all[obj]:bw.ns4?eval(nest+"document.layers." +obj):0; if(!this.evnt) return show_message('該圖層不存在 ('+obj+')' +'- 如果您使用 Netscape,請檢查標籤的嵌套!') this.css=bw.dom||bw .ie4?this.evnt.style:this.evnt; this.ref=bw.dom||bw.ie4?document:this.css.document; this.x=parseInt(this.css.left)||this.css.pixelLeft||this.evnt.offsetLeft||0; this.y=parseInt(this.css.top)||this.css.pixelTop||this.evnt.offsetTop||0 this.w=this.evnt.offsetWidth||this.css.clip.width|| this.ref.width||this.css.pixelWidth||0; this.h=this.evnt.offsetHeight||this.css.clip.height|| this.ref.height||this.css.pixelHeight||0 this.c=0 if((bw.dom || bw.ie4) && this.css.clip) { this.c=this.css.clip; this.c=this.c.slice(5,this.c.length-1); this.c=this.c.split(' '); for(var i=0;i<4;i++){this.c[i]=parseInt(this.c[i])} } this.ct=this.css.clip.top||this.c[0 ]||0; this.cr=this.css.clip.right||this.c[1]||this.w||0 this.cb=this.css.clip.bottom||this.c[2]||this. h||0; this.cl=this.css.clip.left||this.c[3]||0 this.obj = obj + "物件"; eval(this.obj + "=this") 傳回此 } lib_obj.prototype.showIt = function(){this.css.visibility="visible"} lib_obj.prototype.hideIt = function(){this.css.visibility= 「隱藏」} lib_obj.prototype.writeIt = function(text,startHTML,endHTML){ if(bw.ns4){ if(!startHTML){startHTML=""; endHTML=""} this.ref.open("text/html"); this.ref.write(startHTML+text+endHTML); this.ref.close() }else this.evnt.innerHTML=text } ////****************(DHTMLCentral.com)******** **** ******//// /* 程式碼取自DynamicDrive.com (Start)--> Gradual-Highlight Image Script II- 作者:J. Mark Birenbaum (birenbau@ugrad.cs.ualberta. ca) 完整版本腳本來源,請造訪 http://dynamicdrive.com */ nereidFadeObjects = new Object();nereidFadeTimers = new Object();函數 nereidFade(object, destOp, rates, delta){ if (!document.all)return if (object != "[object]"){ setTimeout("nereidFade("+object+","+destOp+","+rate+ ","+delta+")",0);返回;}clearTimeout(nereidFadeTimers[object.sourceIndex]); diff = destOp-object.filters.alpha.opacity;方向=1; if (object.filters.alpha.opacity > destOp){direction = -1;} delta=Math.min(direction*diff,delta); object.filters.alpha.opacity+=方向*delta; if (object.filters.alpha.opacity != destOp){ nereidFadeObjects[object.sourceIndex]=object; nereidFadeTimers[object.sourceIndex]=setTimeout("nereidFade(nereidFadeObjects["+object.sourceIndex+"],"+destOp+","+rate+","+delta+")",rate); } } // <-- 程式碼取自DynamicDrive.com(完) window.onload=new logoCurveInit(); //--> 結束隱藏</SCRIPT><br><br><br><br><br><br><br><br> 用滑鼠點選圖片就可以看到非常好的效果! </div>