将以下JS代码另存为js文件 用<script src="你的取名.js" language="javascript"></script>调用
// javascript Document
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("lovexin12").style.top=parseInt(document.getElementById("lovexin12").style.top)+percent+"px";
document.getElementById("lovexin14").style.top=parseInt(document.getElementById("lovexin12").style.top)+percent+"px";
lastScrollY=lastScrollY+percent;
//alert(lastScrollY);
}
suspendcode12="<DIV id=\"lovexin12\" style='left:22px;POSITION:absolute;TOP:69px;'><a href='http://www.jz123.cn' target='_blank'><img border=0 src=UploadFiles/2007622185240734.gif><br><a href=javascript:; onclick=\"lovexin12.style.visibility='hidden'\"><img border=0 src=UploadFiles/2007622185242580.gif></a></div>"
suspendcode14="<DIV id=\"lovexin14\" style='right:22px;POSITION:absolute;TOP:69px;'><a href='http://www.jz123.cn' target='_blank'><img border=0 src=UploadFiles/2007622185240734.gif><br><a href=javascript:; onclick=\"lovexin14.style.display = 'none'\"><img border=0 src=UploadFiles/2007622185242580.gif></div>"
document.write(suspendcode12);
document.write(suspendcode14);
window.setInterval("heartBeat()",1);
自己修改的插FLASH的方法,需要用旧的FLASH插入方法,新的会失效,right:5px;POSITION:absolute;TOP:10px; 这行代码可以用来调位置:
// javascript Document
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("lovexin12").style.top=parseInt(document.getElementById("lovexin12").style.top)+percent+"px";
document.getElementById("lovexin14").style.top=parseInt(document.getElementById("lovexin12").style.top)+percent+"px";
lastScrollY=lastScrollY+percent;
//alert(lastScrollY);
}
suspendcode12="<DIV id=\"lovexin12\" style='left:5px;POSITION:absolute;TOP:10px;'><EMBED src='swf/gg1.swf' quality=high WIDTH=96 HEIGHT=380 TYPE='application/x-shockwave-flash'></EMBED><br><a href=javascript:; onclick=\"lovexin12.style.visibility='hidden'\"><img border=0 src=images/close2.gif></a></div>"
suspendcode14="<DIV id=\"lovexin14\" style='right:5px;POSITION:absolute;TOP:10px;'><EMBED src='swf/gg2.swf' quality=high WIDTH=96 HEIGHT=380 TYPE='application/x-shockwave-flash'></EMBED><br><a href=javascript:; onclick=\"lovexin14.style.display = 'none'\"><img border=0 src=images/close2.gif></a></div>"
document.write(suspendcode12);
document.write(suspendcode14);
window.setInterval("heartBeat()",1);