CSS控制表头固定出现抖动的问题

淅沥加油 2012-07-02 04:44:22
我使用如下CSS控制表头固定,但是拖动滚动条的时候表头会出现抖动的现象,请问这是什么原因啊
.FixedTitleRow {
position: relative;
top: expression(this.offsetParent.scrollTop);
background-color: #CCC;
z-index: 1;
}
...全文
566 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
001007009 2012-07-02
  • 打赏
  • 举报
回复

<!doctype html>
<html>
<head>
<meta charset="gb2312" />
<title></title>
<style>
body,div{ margin:0; padding:0; color:#333;}
.main{ width:960px; height:1000px; margin:0 auto; padding-top:300px; edui-filter-align-center }
.fixbar{position:fixed; width:100%; height:23px;padding-top:8px;bottom:0;left:0;border-top:4px solid #09C; overflow:hidden;}
.fixbar-wrap{width:960px;margin:0 auto}
*html,*html body /* 修正IE6振动bug */{background-image:url(about:blank);background-attachment:fixed;}
*html .fixbar{position:absolute;bottom:auto;top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop,10)||0)-(parseInt(this.currentStyle.marginBottom,10)||0)));}
*html .fixbar{position:absolute;right:auto;left:expression(eval(document.documentElement.scrollLeft));}
</style>
</head>
<body>
<div class="main">这是主体内容</div>
<div class="fixbar">
<div class="fixbar-wrap">这是底部的内容</div>
</div>
</body>
</html>




参考下
d945332077 2012-07-02
  • 打赏
  • 举报
回复
表头是什么???expression这个只有在IE下面才有效果,跟写js是一个效果,我还不如写js呢,在你拖动滚动条的时候它会动态去计算离top的高度,而特别是IE6下面的JS引擎效率有点低所以抖动比较明显,应该是这样,如果你要固定还不如直接写position:flexd;这样就固定了。哦 我知道了 楼主估计是IE6下的这个问题吧? 如果还有问题发站内消息 我在的
  • 打赏
  • 举报
回复
设置:position 为fixed 算了,不考虑ie6了

61,112

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧