var pagewidth = 1000; //页面多少宽度象素下正好不出现左右滚动条 var addivw = 120; //宽度 lastscrolly=-100; 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("duilianleft").style.top=parseint(document.getelementbyid("duilianleft").style.top)+percent+"px"; document.getelementbyid("duilianleft").style.left=document.documentelement.scrollleft+borderpx; document.getelementbyid("duilianright").style.top=parseint(document.getelementbyid("duilianright").style.top)+percent+"px"; document.getelementbyid("duilianright").style.right=document.documentelement.scrollleft+borderpx; //document.getelementbyid("duilianleft").style.top=20; //document.getelementbyid("duilianright").style.top=20; lastscrolly=lastscrolly+percent; //alert(lastscrolly); } suspendcodeleft="
" suspendcoderigh="" var borderpx = ((window.screen.width-pagewidth)/2-addivw)/2; document.write(suspendcoderigh); document.write(suspendcodeleft); window.setinterval("heartbeat()",1);