用absolute来模拟fixed效果:

/*相当于正常的position:fixed;top:0 */
.sl_fixed_top{bottom:auto;top:0;_bottom:auto;_top:expression(eval(document.documentElement.scrollTop))};

/ *相当于正常的position:fixed;bottom:0 */
.sl_fixed_bottom{top:auto;bottom:0;_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)))};

/* 相当于正常的position:fixed;left:0 */
.sl_fixed_left{left:0;right:auto;_right:auto;_left:expression(eval(document.documentElement.scrollLeft))};

/* 相当于正常的position:fixed;right:0 */

.sl_fixed_right{left:auto;right:0;_right:auto;

_left:expression(eval(document.documentElement.scrollLeft+document.documentElement.clientWidth-this.offsetWidth-(parseInt(this.currentStyle.marginLeft,10)||0)-(parseInt(this.currentStyle.marginRight,10)||0)))
};

.sl_fixed_top,.sl_fixed_right,.sl_fixed_bottom,.sl_fixed_left{_position:absolute;}

position置顶或某固定位置 兼容ie6ie7的更多相关文章

  1. js之滚动置顶效果

    0.js获取高度 ? 1 2 3 4 5 6 document.all   // 只有ie认识   document.body.clientHeight              // 文档的高,屏幕 ...

  2. Javascript笔记----实现Page页面右下角置顶按钮.

    从用博客开始,发现博客园中很多博友的博客中在Page右下角都有个图标,不论屏幕怎么拉伸,都始终停留在右下角.点击后页面置顶.后面想想写一个Demo来实现这种效果吧. 一. 图标右下角固定. 1.SS ...

  3. [知了堂学习笔记]_css3特效第二篇--行走的线条&&置顶导航栏

    一.行走的线条. 效果图(加载可能会慢一点儿,请稍等...): html代码: <div class="movingLines"> <img src=" ...

  4. css3特效第二篇--行走的线条&&置顶导航栏

    一.行走的线条. 效果图(加载可能会慢一点儿,请稍等...): html代码: <div class="movingLines"> <img src=" ...

  5. html简单响应式滚动条置顶

    简单响应式滚动条置顶 一般的,让页面出现滚动条的常见方法有: overflow:auto||overflow:scroll 或者overflow-x水平滚动条和overflow-y垂直滚动条 那么现在 ...

  6. 在UWP中页面滑动导航栏置顶

    最近在研究掌上英雄联盟,主要是用来给自己看新闻,顺便copy个界面改一下段位装装逼,可是在我copy的时候发现这个东西 当你滑动到一定距离的时候导航栏会置顶不动,这个特性在微博和淘宝都有,我看了@ms ...

  7. JavaScript学习笔记-元素在滚动条滑动一定高度后自动置顶

    <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content ...

  8. QQ好友列表向左滑动出现置顶、删除--第三方开源--SwipeMenuListView

    SwipeMenuListView是在github上的第三方开源项目,该项目在github上的链接地址是:https://github.com/baoyongzhang/SwipeMenuListVi ...

  9. ie6下固定位置的实现

    <!doctype html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

随机推荐

  1. 《BI项目笔记》基于雪花模型的维度设计

    GBGradeCode 外键关系: 1 烟叶等级 T_GBGradeCode.I_DistinctionID=T_Distinction.I_DistinctionID 烟叶等级分为:上等烟.中等烟. ...

  2. seek指针大文件上传

    package mainimport (    // "bufio"    "fmt"    "github.com/axgle/mahonia&qu ...

  3. Failed to execute goal org.codehaus.mojo:rpm-maven-plugin:2.1.1:rpm (default) on project **

    maven编译项目时报错:Failed to execute goal org.codehaus.mojo:rpm-maven-plugin:2.1.1:rpm (default) on projec ...

  4. git github 异常

    git :版本控制工具 github:项目托管 git clone failed:git是否安装正确 github commit failed:github 是否账号 / 密码是否正确(密码错误也可以 ...

  5. mybatis批量更新 UPDATE mysql

    oracle和mysql数据库的批量update在mybatis中配置不太一样: oracle数据库: <update id="batchUpdate" parameterT ...

  6. 安装mongodb

    安装mongodb的时候遇到一些麻烦 首先将安装包下下来 安装的是windows版本的 将bin文件夹加入环境变量后通过mongod和mongo指令就可以进行操作,很方便 用指令mongod --db ...

  7. 【C++】rand()函数,时间种子

    srand((unsigned)time(NULL)); //以时间为随机种子,写在循环前才有效(几个循环无所谓) ;i<=size;i++) { ;j<=size;j++) { ==ra ...

  8. java日期操作大全

    摘自(http://www.blogjava.net/i369/articles/83483.html) java日期操作 大全 先来一个:  取得指定月份的第一天与取得指定月份的最后一天  http ...

  9. State(状态)

    props和state.props是在父组件中指定,而且一经指定,在被指定的组件的生命周期中则不再改变. 对于需要改变的数据,我们需要使用state.般来说,你需要在constructor中初始化st ...

  10. VS2010创建WebService的步骤

    1.新建网站 ---ASP.NET 空网站 2.添加新项---Web服务..