一聚教程网:一个值得你收藏的教程网站

热门教程

兼容多浏览左右浮动广告代码

时间:2022-11-14 22:03:43 编辑:袖梨 来源:一聚教程网

兼容多浏览左右浮动广告代码
var w3c = (document.getElementById) ? true : false;
var agt = navigator.userAgent.toLowerCase();
var ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1) && (agt.indexOf("omniweb") == -1));
var mymovey = new Number();
function IeTrueBody(){
return (document.compatMode && document.compatMode!="BackCompat") ? document.documentElement : document.body;
}
function GetScrollTop(){
return ie ? IeTrueBody().scrollTop : window.pageYOffset;
}
function heartBeat(){
diffY=GetScrollTop();
mymovey += Math.floor((diffY-document.getElementById('backr').style.top.replace("px","")+0)*0.1);
document.getElementById('backr').style.top = mymovey+"px";
}
window.setInterval("heartBeat()",1);
function hidethis(){
document.getElementById('backr').style.display = "none";
}
document.write("

");
document.write("
");
document.write("fdsfsfdsfdsfd");
document.write("
");

热门栏目