中文(简体)
<STYLE type=text/css>#floater { Z-INDEX: 10;左:500 像素;可见性:可见;宽度:125 像素;位置:绝对;顶部:146px } </STYLE> <STYLE type=text/css> TD { 字体大小:9pt; LINE-HEIGHT: 11pt } </STYLE> </HEAD> <BODY > <DIV id=floater style="LEFT: 0px; WIDTH: 89px; TOP: 137px; HEIGHT: 40px"> <TABLE cellSpacing=0 cellPadding=0宽度=75 bgColor=#0000ff 边框=1> <TR> <TD 宽度=10><B><IMG id=fpAnimswapImgFP1 高度=200 宽度=200 lowsrc=/img/200406301.jpg 边框=0 名称=fpAnimswapImgFP1 动态动画= "fpAnimswapImgFP1"></B></TD> <TDalign=middle width=30>网页<BR>教学</TD></TR> </TABLE> </DIV> <SCRIPT language=JavaScript> self. onError=空;当前X = 当前Y = 0;它 = null;最后滚动X = 0;最后滚动Y = 0; NS = (文档.层) ? 1:0; IE = (文档.全部) ? 1:0; <!-- STALKER 代码 --> function heartBeat() { if(IE) { diffY = document.body.scrollTop; diffX = document.body.scrollLeft; } if(NS) { diffY = self.pageYOffset; diffX = self.pageXOffset; } if(diffY != lastScrollY) { 百分比 = .1 * (diffY - lastScrollY); if(百分比 > 0) 百分比 = Math.ceil(百分比);否则百分比 = Math.floor(百分比); if(IE) document.all.floater.style.pixelTop += 百分比; if(NS) document.floater.top += 百分比;最后滚动Y = 最后滚动Y + 百分比; } if(diffX != lastScrollX) { 百分比 = .1 * (diffX - lastScrollX); if(百分比 > 0) 百分比 = Math.ceil(百分比);否则百分比 = Math.floor(百分比); if(IE) document.all.floater.style.pixelLeft += 百分比; if(NS) document.floater.left += 百分比;最后滚动X = 最后滚动X + 百分比; } } <!-- /STALKER 代码 --> <!-- 拖放代码 --> function checkFocus(x,y) { stalkerx = document.floater.pageX;跟踪 = document.floater.pageY; stalkerwidth = document.floater.clip.width; stalkerheight = document.floater.clip.height; if( (x > stalkerx && x < (stalkerx+stalkerwidth)) && (y > stalkery && y < (stalkery+stalkerheight))) 返回 true;否则返回 false; } 函数grabIt(e) { if(IE) { whichIt = event.srcElement; while (whichIt.id.indexOf("floater") == -1) { whichIt = whichIt.parentElement; if (whichIt == null) { 返回 true; whichIt.style.pixelLeft = whichIt.offsetLeft; whichIt.style.pixelTop = whichIt.offsetTop; currentX = (event.clientX + document.body.scrollLeft); currentY = (event.clientY + document.body.scrollTop); } else { window.captureEvents(Event.MOUSEMOVE); if(checkFocus (e.pageX,e.pageY)) {whichIt = document.floater; StalkerTouchedX = e.pageX-document.floater.pageX; StalkerTouchedY = e.pageY-document.floater.pageY;返回真; } function moveIt(e) { if (whichIt == null) { return false; } } if(IE) { newX = (event.clientX + document.body.scrollLeft); newY = (event.clientY + document.body.scrollTop);距离X = (新X - 当前X);距离Y = (新Y - 当前Y);当前X = 新X;当前Y = 新Y; whichIt.style.pixelLeft += distanceX; whichIt.style.pixelTop += distanceY; if(whichIt.style.pixelTop < document.body.scrollTop) whichIt.style.pixelTop = document.body.scrollTop; if(whichIt.style.pixelLeft < document.body.scrollLeft) whichIt.style.pixelLeft = document.body.scrollLeft; if(whichIt.style.pixelLeft > document.body.offsetWidth - document.body.scrollLeft -whichIt.style.pixelWidth - 20)whichIt.style.pixelLeft = document.body.offsetWidth -whichIt.style.pixelWidth - 20; if(whichIt.style.pixelTop > document.body.offsetHeight + document.body.scrollTop -whichIt.style.pixelHeight - 5)whichIt.style.pixelTop = document.body.offsetHeight + document.body.scrollTop -whichIt.style。像素高度 - 5;事件.returnValue = false; } else { whichIt.moveTo(e.pageX-StalkerTouchedX,e.pageY-StalkerTouchedY); if(whichIt.left < 0+self.pageXOffset) whichIt.left = 0+self.pageXOffset; if(whichIt.top < 0+self.pageYOffset) whichIt.top = 0+self.pageYOffset; if( (whichIt.left + whichIt.clip.width) >= (window.innerWidth+self.pageXOffset-17)) whichIt.left = ((window.innerWidth+self.pageXOffset)-whichIt.clip.width)-17 ; if( (whichIt.top + whichIt.clip.height) >= (window.innerHeight+self.pageYOffset-17)) whichIt.top = ((window.innerHeight+self.pageYOffset)-whichIt.clip.height)-17 ;返回假;返回假; } //来自 http://www.downcodes.com 的更多 javascript function dropIt() {whichIt = null; if(NS) window.releaseEvents (Event.MOUSEMOVE);返回真; } <!-- 拖放代码 --> if(NS) { window.captureEvents(Event.MOUSEUP|Event.MOUSEDOWN); window.onmousedown = 抓住它; window.onmousemove = moveIt; window.onmouseup = dropIt; } if(IE) { document.onmousedown = scrapIt; document.onmousemove = moveIt; document.onmouseup = dropIt; } if(NS || IE) action = window.setInterval("heartBeat()",1); </SCRIPT> <br>e<br>e<br>e<br>e<br>e<br>e<br>e<br>e<br>e<br>e<br>e<br >e<br>e<br>e<br>e<br>e<br>e<br>e<br>e<br>e<br>e<br>e<br>e<br>e <br>e<br>e<br>e<br>e<br>e<br>e<br>e<br>e<br>e<br>e<br>e<br>e<br> >e<br>e<br>e<br>e<br>e<br>e<br>e<br>e<br>e<br>e<br>e<br>e <br>e <br>e<br>e<br>e<br>e<br>e<br>e<br>e<br>e<br>e<br>e<br>e<br>e<br> >e<br>e<br>e<br>e<br>e<br>e<br>e<br>e<br>e<br>e<br>e </BODY></HTML>