IE6.0及以下版本的浏览器里是不支持position:fixed的。ie7+,firefox,chrome,opera都是可以完美支持的。
解决此问题的要点主要有:
1).容器要有一个背景图片
2).设置它的滚动属性为fixed。
3).用IE特有的e-xpression方法计算出元素的top,left,right,bottom的量。
/* 除IE6浏览器的通用方法 */
.ie6_box{position:fixed;right:0;bottom:105} 效果与下同
/* IE6浏览器的特有方法 */
/* 修正IE6振动bug */
/*_background-p_w_picpath:url(about:blank);用浏览器空白页面作为背景*/
/*_background-p_w_upload:fixed 确保滚动条滚动时,元素不闪动*/
* html,* html body{background-p_w_picpath:url(about:blank);background-p_w_upload:fixed}
* html .ie6_box{_position:absolute;_left:expression(eval(document.documentElement.scrollLeft+document.documentElement.clientWidth-this.offsetWidth)-(parseInt(this.currentStyle.marginLeft,10)||0)-(parseInt(this.currentStyle.marginRight,10)||0));_top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop,10)||0)-(parseInt(this.currentStyle.marginBottom,10)||105)))}
注意:这里计算出来的left是其他浏览器的right值。top是其他浏览器的bottom.值.
转载于:https://blog.51cto.com/imperial/1203784