最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
ie6中pisition:fixed不起作用,浮窗不随屏滚动解决办法
时间:2022-06-25 11:18:49 编辑:袖梨 来源:一聚教程网
按网上的说明,下面的这段css中的_top好像起不到作用.
| 代码如下 | 复制代码 |
|
.jumpbox{ _top: expression(eval(document.compatMode && |
|
后来百度了一下
加上个属性
| 代码如下 | 复制代码 |
| _top:expression(eval(document.documentElement.scrollTop)); | |
就OK了!
利用IE特殊支持的CSS表达式以及position:absolute完美解决这个BUG。。
PS.以上方法还需要在html加入如下属性:
| 代码如下 | 复制代码 |
|
background-image:url(about:blank); |
|
最后我们再来整理一下
1、ie6下 position:fixed 设置
#bot-fixed{position:fixed;_postion:absolute;bottom:0;_bottom:auto;right:20px;_top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop,10)||0)-(parseInt(this.currentStyle.marginBottom,10)||0)));}
2、元素固定在浏览器的顶部和底部设置方法(针对IE6)
A:元素固定在浏览器的顶部:
| 代码如下 | 复制代码 |
|
#bot-fixed{_position:absolute;_bottom:auto;_top:expression(eval(document.documentElement.scrollTop));} |
|
B:元素固定在浏览器的底部:
| 代码如下 | 复制代码 |
|
#bot-fixed{_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)));} |
|
3、解决position:fixed 层闪烁 的方法
在css样式表中添加
| 代码如下 | 复制代码 |
| *html{ background-image:url(about:blank); background-attachment:fixed; } | |
属性
我们也可以使用js来解决些问题了
| 代码如下 | 复制代码 |
|
g1 = (getClientHeight() – o.height) / 2;//1000px总 元素高300px 则 g1=350px }) } |
|
相关文章
- jm天堂网页版官方登录入口-jm天堂网页版直接登录入口 12-14
- 蝉妈妈网页版直达入口-蝉妈妈app官方正版入口在哪 12-14
- 豆包AI智能在线网页解析神器-豆包AI智能在线会议纪要生成助手 12-14
- 小红书Web官网登录入口-小红书官方网页版一键登录 12-14
- 苍云阅读app如何快速找到目录-目录入口位置 12-14
- 苹果ID登录官网入口 - 苹果Apple ID账户登录页面一键直达 12-14