轻舞飞扬的动画效果 (酷) dn001 2009-06-21 08:19:49 <!--把下列代码放到body区域内--> <script language="JavaScript"> self.onError = null; currentX = currentY = 0; whichIt = null; lastScrollX = 0; lastScrollY = 0; NS = (document.layers) ? 1 : 0; IE = (document.all) ? 1: 0; <!-- STALKER CODE --> function heartBeat(objectid) { if(IE) { diffY = document.body.scrollTop; diffX = document.body.scrollLeft; } if(NS) { diffY = self.pageYOffset; diffX = self.pageXOffset; } if(diffY != lastScrollY) { percent = .1 * (diffY - lastScrollY); if(percent > 0) percent = Math.ceil(percent); else percent = Math.floor(percent); if(IE) { objectid = objectid.split(";"); for (i = 0; i < objectid.length; i++) eval("document.all."+objectid[i]).style.pixelTop += percent; } if(NS) { objectid = objectid.split(";"); for (i = 0; i < objectid.length; i++) eval("document."+objectid[i]).top += percent; } lastScrollY = lastScrollY + percent; } if(diffX != lastScrollX) { percent = .1 * (diffX - lastScrollX); if(percent > 0) percent = Math.ceil(percent); else percent = Math.floor(percent); if(IE) { objectid = objectid.split(";"); for (i = 0; i < objectid.length; i++) eval("document.all."+objectid[i]).style.pixelLeft += percent; } if(NS) { objectid = objectid.split(";"); for (i = 0; i < objectid.length; i++) eval("document."+objectid[i]).left += percent; } lastScrollX = lastScrollX + percent; } } <!-- /STALKER CODE --> if(NS || IE) action = window.setInterval("heartBeat('floater;floater1;floater2;floater3')", 5); if (IE){ document.write("<DIV id='floater' style='LEFT: 5px; TOP: 310px; POSITION: absolute; WIDTH: 83; VISIBILITY: visible; Z-INDEX: 10;'><a href='http://www.knowsky.com' target='_blank'><IMG src='http://www.tfol.com/tanfo/images/200505/100_100_0517.gif' height='100' width='100' border='0'></a></DIV>") document.write("<DIV id='floater1' style='LEFT: 5px; TOP: 420px; POSITION: absolute; WIDTH: 83; VISIBILITY: visible; Z-INDEX: 10;'><a href='http://www.knowsky.com' target='_blank'><IMG src='http://www.tfol.com/tanfo/images/200505/517_100_100.gif' height='80' width='80' border='0'></a></DIV>") document.write("<DIV id='floater2' style='right: 5px; TOP: 310px; POSITION: absolute; WIDTH: 83; VISIBILITY: visible; Z-INDEX: 10;'><a href='http://bbs.knowsky.com/' target='_blank'><IMG src='http://www.tfol.com/tanfo/images/200505/hjh_banner100_100_0513.gif' height='100' width='100' border='0'></a></DIV>") //document.write("<DIV id='floater3' style='right: 5px; TOP: 420px; POSITION: absolute; WIDTH: 83; VISIBILITY: visible; Z-INDEX: 10;'><a href='http://www.knowsky.com/' target='_blank'><IMG src='http://www.tfol.com/tanfo/images/200505/80_80_0518.gif' height='80' width='80' border='0'></a></DIV>") document.write("<DIV id='floater3' style='right: 5px; TOP: 420px; POSITION: absolute; WIDTH: 83; VISIBILITY: visible; Z-INDEX: 10;'><a href='http://www.knowsky.com' target='_blank'><IMG src='http://www.tfol.com/tanfo/images/200505/80_80_0530.gif' height='80' width='80' border='0'></a></DIV>") } if (NS){ document.write("<layer id=myleft top=400 width=80 height=80></layer>"); } </script>