zoukankan      html  css  js  c++  java
  • 新浪微博顶部新评论提示层效果——position:fixed

    <!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>
  • 相关阅读:
    margin塌陷(collapse)
    this的值
    变量、函数声明提升
    Git与Svn的区别—笔记1
    ECMAScript 总结
    正则表达式
    i2c 通信
    player/stage 学习---安装
    各种分区类型对应的partition_Id
    ubuntu 映射网络驱动器到本地
  • 原文地址:https://www.cnblogs.com/hubing/p/3261425.html
Copyright © 2011-2022 走看看