Home  >  Article  >  php教程  >  javascript对联广告 兼容 IE FF

javascript对联广告 兼容 IE FF

WBOY
WBOYOriginal
2016-06-06 20:00:581257browse

// 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);

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn