div 重叠

<html>
    <head>
    <style>
        .first{
            width: 366px;height: 184px;
        //    position: relative;
            text-align:left;
            z-index:1000;
            display: none;
            color: red;
        }

        .second{
            width: 366px;height:184px;top:0px;
            position: absolute;
            color: blue;
        }

        body > div {
            position: relative;
        }
    </style>
    </head>
<body>
    <div >
        <div id="first" class="first">
            div content-1
        </div>
        <div id="second" class="second">
            div content
        </div>
    </div>
</body>

<script type="text/javascript" src="./js/jquery-2.1.3.min.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
        $("#second").bind("click",function(){
            $("#first").show();
        });
    });
</script>

</html>

 

posted @ 2015-02-23 21:06  Peter_Wu  阅读(330)  评论(0编辑  收藏  举报