您的位置:首页 > Web前端 > JavaScript

浮动层-JS兼容IE6

2013-12-23 11:17 183 查看
//引用jquery 包
/*orderBycat 与 orderBycatHead 双层浮动*/
$(window).scroll(function () {
var top = $(window).scrollTop();
var topDiff = top;
if (top >= 350) {
if ($.browser.msie && ($.browser.version == "6.0")) {
$("#orderBycat").addClass("rightFloatRight");
$("#orderBycatHead").addClass("rightFloatRight");
//预定菜单车
document.getElementById("orderBycat").style.top = topDiff;//菜单栏
document.getElementById("orderBycatHead").style.top = topDiff;

       /*如果固定在大层中,则不需要用 下列定位*/
       document.getElementById("orderBycatHead").style.left = "99px";
       document.getElementById("orderBycat").style.right = "247px";
}
else {
$("#orderBycat").addClass("fix_top");
$("#orderBycatHead").addClass("fix_top");
}
}
else {
$("#orderBycat").removeClass("fix_top");
$("#orderBycat").removeClass("rightFloatRight");
$("#orderBycatHead").removeClass("fix_top");
$("#orderBycatHead").removeClass("rightFloatRight");
}
});


/*去除IE下抖动*/
*html{background-image:url(about:blank);background-attachment:fixed;}

/*浮动*/
.rightFloatRight {
position: absolute;
top: 0;
/*_position:absolute;
left:80px;*/
/*_top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight)-610+"px");*/
}
.fix_top {
bottom: auto;
position: fixed;
top: 0;
z-index: 10000;
/*_position:absolute;
_left:500px;
_top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight)-450+"px");*/
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: