欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程资源 > 编程问答 >内容正文

编程问答

NO。58 新浪微博顶部新评论提示层效果——position:fixed

发布时间:2025/7/14 编程问答 39 豆豆
生活随笔 收集整理的这篇文章主要介绍了 NO。58 新浪微博顶部新评论提示层效果——position:fixed 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

这个层的效果用position:fixed实现的很好,但是就是很纠结的ie6有问题

我今天试自己是这样实现的,但是ie6中滚动条滚动的时候会不停的抖动,不知道怎么是好

<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>fix顶部</title>
<script src="js/jquery-1.3.2.min.js" type="text/javascript" language="javascript"></script>
<style>
*
{padding:0px ; margin:0px;}
.top_nav
{width:100%; height:30px; background:#CCC;}
.fix_box
{width:200px;  height:30px; background-color:#FFC; border:1px solid #F90;right:100px; top:10px; position:fixed; _position:absolute;}
</style>
<!--[if IE 6]>
<script>
$(function(){
    $(window).scroll(function() {
        var scrollsTop = $(this).scrollTop()+10;
        $(".fix_box").css("top",scrollsTop);
    })
})
</script>
<![endif]
-->
</head>

<body>
<div class="top_nav">
    
<div class="fix_box"></div>
</div>
<div style="height:800px;"></div>
</body>

</html> 

 

转载于:https://www.cnblogs.com/00fairy00/archive/2011/05/11/2043375.html

总结

以上是生活随笔为你收集整理的NO。58 新浪微博顶部新评论提示层效果——position:fixed的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。