<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.dyunr.com/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <style type="text/css"> body { height:3000px; } #zzjs_net_1{ width:150px; height:150px; /*background-color:#eee; border:1px solid #ddd;*/ } </style> <script language="javascript" type="text/javascript"> lastScrollY=0; function heartBeat(){ var diffY; if (document.documentElement && document.documentElement.scrollTop) diffY = document.documentElement.scrollTop; else if (document.body) diffY = document.body.scrollTop else {/*Netscape stuff*/} //alert(diffY); percent=.1*(diffY-lastScrollY); if(percent>0)percent=Math.ceil(percent); else percent=Math.floor(percent); document.getElementById("zzjs_net_1").style.top=parseInt(document.getElementById ("zzjs_net_1").style.top)+percent+"px"; lastScrollY=lastScrollY+percent; //alert(lastScrollY); } j1="<div id=\"zzjs_net_1\" style='left:2px;position:absolute;top:120px;'>"+ "<a href='http://www.baidu.com' target='_blank'><img src='http://www.baidu.com/img/bdlogo.gif'/></a></div>" document.write(j1); window.setInterval("heartBeat()",1); </script> </head> <body> </body> </html>