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>
  • 相关阅读:
    只允许在input框输入文字,不能输入数字和其他字符
    阻止用户在input框输入数字
    centos 7.2安装和配置MongoDB
    Python基础
    Python小练习008
    Python小练习007
    Python小练习006
    Python错误集锦
    Python和MongoDB
    MongoDB笔记
  • 原文地址:https://www.cnblogs.com/hubing/p/3261425.html
Copyright © 2011-2022 走看看