Indonesia
<!-- http://www.downcodes.com --> <!-- 完整的HTML代码如下: --> <html> <head> <title>跟随滚动条而滚动的广告条</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <STYLE media=screen type=text/css> #floater { POSISI: absolut; VISIBILITAS: terlihat; LEBAR: 10 piksel; Z-INDEX: 10 } </STYLE> <script Language="JavaScript"> <!-- function MM_reloadPage(init) { //memuat ulang jendela jika Nav4 diubah ukurannya if (init==true) dengan (navigator) {if ( (appName=="Netscape")&&(parseInt(appVersion)==4)) { document.MM_pgW=innerWidth; document.MM_pgH=tinggi bagian dalam; onresize=MM_reloadPage; }} else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload(); } MM_reloadPage(benar); // --> </script> </head> <body bgcolor="#FFFFFF" text="#000000" > <div id="floater" style="position:absolute; kiri:436px; top:60px; lebar:152 piksel; tinggi:178 piksel; indeks-z:12"><img perbatasan=0 src="/u/info_img/2009-06/20/1455_logo.gif" title=怎么样看到效果了吧!>< /div> <Bahasa SKRIP=JavaScript> self.onError=null; arusX = arusY = 0; yang mana = null; gulir terakhirX = 0; Gulir terakhirY = 0; NS = (dokumen.lapisan) ? 1 : 0; IE = (dokumen.semua) ? 1: 0; <!-- KODE STALKER --> function heartBeat() { if(IE) { diffY = document.body.scrollTop; diffX = dokumen.body.scrollLeft; } if(NS) { diffY = self.pageYOffset; diffX = self.pageXOffset; } if(diffY != lastScrollY) { persen = .1 * (diffY - lastScrollY); if(persen > 0) persen = Math.ceil(persen); else persen = Math.floor(persen); if(IE) document.all.floater.style.pixelTop += persen; if(NS) document.floater.top += persen; lastScrollY = lastScrollY + persen; } if(diffX != lastScrollX) { persen = .1 * (diffX - lastScrollX); if(persen > 0) persen = Math.ceil(persen); else persen = Math.floor(persen); if(IE) document.all.floater.style.pixelLeft += persen; if(NS) document.floater.left += persen; lastScrollX = lastScrollX + persen; } } <!-- /STALKER CODE --> <!-- DRAG DROP CODE 鼠标拖放事件--> function checkFocus(x,y) {stalkerx = document.floater.pageX; penguntit = dokumen.floater.pageY; stackerwidth = dokumen.floater.clip.width; tinggi penguntit = dokumen.floater.clip.height; if( (x > penguntitx && x < (penguntitx+lebar penguntit)) && (y > penguntit && y < (penguntit+tinggi penguntit))) mengembalikan nilai true; jika tidak, kembalikan salah; } fungsi ambilIt(e) { if(IE) { yang mana = event.srcElement; while (whichIt.id.indexOf("floater") == -1) { yang mana = yang mana.parentElement; if (yang mana == null) { kembali benar; } } yangItu.gaya.pixelLeft = yangItu.offsetLeft; yang mana.gaya.pixelTop = yang mana.offsetTop; currentX = (event.clientX + dokumen.body.scrollLeft); currentY = (event.clientY + dokumen.body.scrollTop); } else { window.captureEvents(Event.MOUSEMOVE); if(checkFocus (e.pageX,e.pageY)) { yang mana = document.floater; StalkerTouchedX = e.pageX-document.floater.pageX; StalkerTouchedY = e.pageY-document.floater.pageY; } } mengembalikan nilai benar; } fungsi moveIt(e) { if (whichIt == null) { return false; } if(IE) { newX = (event.clientX + document.body.scrollLeft); newY = (event.clientY + dokumen.body.scrollTop); jarakX = (baruX - saat iniX); jarakY = (baruY - saat iniY); currentX = newX; saat iniY = baruY; yangIt.style.pixelLeft += distanceX; yang manaIt.style.pixelTop += jarakY; if(whichIt.style.pixelTop < document.body.scrollTop) yangIt.style.pixelTop = document.body.scrollTop; if(whichIt.style.pixelLeft < document.body.scrollLeft) yangIt.style.pixelLeft = document.body.scrollLeft; if(whichIt.style.pixelLeft > document.body.offsetWidth - document.body.scrollLeft - yangIt.style.pixelWidth - 20) yangIt.style.pixelLeft = document.body.offsetWidth - yangIt.style.pixelWidth - 20; if(whichIt.style.pixelTop > document.body.offsetHeight + document.body.scrollTop - yangIt.style.pixelHeight - 5) yangIt.style.pixelTop = document.body.offsetHeight + document.body.scrollTop - yangIt.style. pikselTinggi - 5; acara.returnValue = false; } else { yang mana.moveTo(e.pageX-StalkerTouchedX,e.pageY-StalkerTouchedY); if(whichIt.left < 0+self.pageXOffset) yangIt.left = 0+self.pageXOffset; if(whichIt.top < 0+self.pageYOffset) yangIt.top = 0+self.pageYOffset; if( (whichIt.left + yangIt.clip.width) >= (window.innerWidth+self.pageXOffset-17)) yangIt.left = ((window.innerWidth+self.pageXOffset)-whichIt.clip.width)-17 ; if( (whichIt.top + yang.clip.height) >= (window.innerHeight+self.pageYOffset-17)) yangIt.top = ((window.innerHeight+self.pageYOffset)-whichIt.clip.height)-17 ; kembali salah; } kembali salah; } fungsi dropIt() { yang mana = null; if(NS) window.releaseEvents (Event.MOUSEMOVE); kembali benar; } <!-- DRAG DROP CODE 鼠标拖放事件--> if(NS) { window.captureEvents(Event.MOUSEUP|Event.MOUSEDOWN); window.onmousedown = ambilIt; window.onmousemove = pindahkan; window.onmouseup = dropIt; } if(IE) { document.onmousedown = ambilIt; dokumen.onmousemove = moveIt; dokumen.onmouseup = dropIt; } if(NS || YAITU) tindakan = window.setInterval("heartBeat()",1); </SCRIPT> <font size="7" color="#FF0000">跟随滚动条而滚动的广告条</font><br> <font size="4" color="#FF0000">(跟随滚动的图层名字:floater,必须使用该名称,跟随滚动,以及拖放属性) </font><br> <br> </body> </html>