欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  php教程

javascript对联广告 兼容 IE FF

程序员文章站 2022-03-25 21:46:56
...

// 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 els

// 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*/}

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;

}
suspendcode12="

javascript对联广告 兼容 IE FF
javascript对联广告 兼容 IE FF
"

suspendcode14="

javascript对联广告 兼容 IE FF
javascript对联广告 兼容 IE FF
"

document.write(suspendcode12);
document.write(suspendcode14);
window.setInterval("heartBeat()",1);