首頁 >php教程 >php手册 >javascript对联广告 兼容 IE FF

javascript对联广告 兼容 IE FF

WBOY
WBOY原創
2016-06-06 20:00:581399瀏覽

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

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn