无抖动层回到顶部(兼容所有主流浏览器)
2011-11-16 16:38
316 查看
不用多说直接贴代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<style type="text/css">
.go-top
{ position: fixed;cursor:default;right: 50px;bottom: 30px;width: auto; height: auto; padding: 4px; padding-top:8px; border: 1px solid gray; font-size: 12px;
height: 20px;background-color: #DDDDDD;vertical-align:middle;_position: absolute; _top: expression((ff=document.documentElement.scrollTop + document.documentElement.clientHeight - this.offsetHeight)+'px'); }
*{ _text-overflow: ellipsis;}
</style>
</head>
<body>
<div style="background-color: red;">页眉</div>
<div style="margin-top: 2000px; background-color: red;">页脚</div>
<div class="go-top" onclick="location.href='#'">TOP</div>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<style type="text/css">
.go-top
{ position: fixed;cursor:default;right: 50px;bottom: 30px;width: auto; height: auto; padding: 4px; padding-top:8px; border: 1px solid gray; font-size: 12px;
height: 20px;background-color: #DDDDDD;vertical-align:middle;_position: absolute; _top: expression((ff=document.documentElement.scrollTop + document.documentElement.clientHeight - this.offsetHeight)+'px'); }
*{ _text-overflow: ellipsis;}
</style>
</head>
<body>
<div style="background-color: red;">页眉</div>
<div style="margin-top: 2000px; background-color: red;">页脚</div>
<div class="go-top" onclick="location.href='#'">TOP</div>
</body>
</html>
相关文章推荐
- 兼容IE,chrome 等所有浏览器 回到顶部代码
- 导航栏固定 和 回到顶部 防抖动兼容ie6
- 怎么把网站全站变黑白(如地震哀悼网站变黑白), 要兼容所有主流浏览器
- jquery实现简单的拖拽效果实例兼容所有主流浏览器(优化篇)
- JavaScript 实现命名空间(namespace)的最佳方案——兼容主流的定义类(class)的方法,兼容所有浏览器,支持用JSDuck生成文档
- jquery实现简单的拖拽效果实例兼容所有主流浏览器(优化篇)
- 基于Html5的兼容所有主流浏览器的在线视频播放器videoJs
- 基于Html5的兼容所有主流浏览器的在线视频播放器videoJs
- html5结合flash实现视频文件在所有主流浏览器兼容播放
- 纯CSS打造一个顶部工具条(兼容所有浏览器)
- JQuery自动轮播效果,带字幕说明,带底部滚动圈圈,兼容IE7以上所有主流浏览器。(魔兽背景哟亲)
- html5结合flash实现视频文件在所有主流浏览器兼容播放
- jquery实现简单的拖拽效果实例兼容所有主流浏览器
- Easy.Ajax 部分源代码 支持文件上传功能, 兼容所有主流浏览器
- 不用JS也能让工具栏悬浮于网页顶部(兼容所有浏览器)
- 这样用css写渐变,兼容所有主流浏览器
- 纯js实现网页返回顶部功能(万能的兼容目前所有浏览器)
- jquery实现简单的拖拽效果实例兼容所有主流浏览器
- JS 清空input file的值,兼容所有主流浏览器
- 【代码片段】jquery 回到顶部效果(全兼容浏览器)可自定义出现位置和页面宽度