![]() |
||
|
Junior Member
![]() ![]() ![]() 加入日期: Apr 2002
文章: 745
|
|
|||||||
|
|
|
Golden Member
![]() ![]() ![]() ![]() 加入日期: Sep 2001 您的住址: =風鈴草文具店=
文章: 3,186
|
引用:
看不到網頁..... 您所說的應該是"書籤"功能 按下後會跑到原本設定時的位置 |
|||
|
|
|
Golden Member
![]() ![]() ![]() ![]() 加入日期: Sep 2001 您的住址: =風鈴草文具店=
文章: 3,186
|
引用:
Javascript 滿簡單的 你把這段貼上就有,不過圖檔的路徑要自己修改 </script><script language="Javascript"> <!-- Begin window.onerror = null; var topMargin = 350;// 上面定位距離 var sTime = 1200; var ns6 = (!document.all && document.getElementById); var ie4 = (document.all); var ns4 = (document.layers); function showlay1(id,left) { if (ns6) { this.obj = document.getElementById(id).style; this.obj.left = left; return this.obj; } else if(ie4) { this.obj = document.all[id].style; this.obj.left = left; return this.obj; } else if(ns4) { this.obj = document.layers[id]; this.obj.left = left; return this.obj; } } function showlay2() { showLyr = new showlay1('floatLayer', pageWidth);// window.setInterval("showmain()", 10) } function showlay3() { if (ns4 || ns6) { findHt = window.innerHeight; } else if(ie4) { findHt = document.body.clientHeight; } } function showmain() { if (ns4) { this.currentY = document.layers["floatLayer"].top; this.scrollTop = window.pageYOffset; main1(); } else if(ns6) { this.currentY = parseInt(document.getElementById('floatLayer').style.top); this.scrollTop = scrollY; main1(); } else if(ie4) { this.currentY = floatLayer.style.pixelTop; this.scrollTop = document.body.scrollTop; main1(); } } function main1() { var newT = this.scrollTop + this.topMargin; if ( this.currentY != newT ) { if ( newT != this.targetY ) { this.targetY = newT; showStart(); } showgo(); } } function showStart() { var now = new Date(); this.A = this.targetY - this.currentY; this.B = Math.PI / ( 2 * this.sTime ); this.C = now.getTime(); if (Math.abs(this.A) > this.findHt) { this.D = this.A > 0 ? this.targetY - this.findHt : this.targetY + this.findHt; this.A = this.A > 0 ? this.findHt : -this.findHt; } else { this.D = this.currentY; } } function showgo() { var now = new Date(); var newY = this.A * Math.sin( this.B * ( now.getTime() - this.C ) ) + this.D; newY = Math.round(newY); if (( this.A > 0 && newY > this.currentY ) || ( this.A < 0 && newY < this.currentY )) { if ( ie4 )document.all.floatLayer.style.pixelTop = newY; if ( ns4 )document.layers["floatLayer"].top = newY; if ( ns6 )document.getElementById('floatLayer').style.top = newY + "px"; } } function startnow() { if(ns6||ns4) { pageWidth = (innerWidth /2) + 350; pageHeight = innerHeight; showlay2(); showlay3(); } else if(ie4) { pageWidth = document.body.clientWidth/2 + 350; pageHeight = document.body.clientHeight; showlay2(); showlay3(); } } // End --> <!-- // var flash_w = 80; if(navigator.appVersion.charAt(0)>='4') { if(navigator.appName.indexOf("Netscape")==-1){ document.write('<div id="floatLayer" style="position:absolute; left: 820px; top: 150px; width: 31px; height: 11px; Z-INDEX: 100">'); document.write('<a href="#top"><img src="../images/top.gif" border="0" alt="本頁頂端"></a>'); document.write('</div>'); } else { document.write('<layer id="floatLayer" position="absolute" left=820 top=150 width=31 height="11">'); document.write('<a href="#top"><img src="../images/top.gif" border="0" alt="本頁頂端"></a>'); document.write('</layer>'); } } // startnow(); //--> </script> 此文章於 2004-09-04 06:05 PM 被 mpc 編輯. |
|
|
|