需求不明确,先想明白,到底要做啥?

解决方案 »

  1.   


    <html>
    <head>
        <title>测试</title>
        <script type="text/javascript" src="jquery1.9.1.js"></script>
        <script type="text/javascript">        $(function () {            //$(".rela").on("mouseout",".show", function () {
                //    $(this).remove();
                //});
                $(".rela").hover(function () {
                    
                    var obj = "<div class=\"show\"></div>";
                            
                    $(this).children(".show").remove();
                    $(this).append(obj);
                }, function () {
                    $(this).find(".show").remove();
                });
                //$(".show").hover(function () { }, function () { alert(""); $(this).remove();});
            });
        </script>
        <style type="text/css">
            .rela {
                position: relative;
                display: block;
            }        .keshi {
                cursor: pointer;
                display: block;
            }        .show {
                position: absolute;
                background: #000;
                width: 100%;
                height: 100%;
                text-align: center;
                top: 0px;
                left: 0px;
                opacity: 0.8;
            }            .show a {
                    color: red;
                }        li {
                width: 200px;
                float: left;
                margin-left: 12px;
                line-height: 24px;
                height: 20px;
            }
        </style>
    </head>
    <body>
        <div style="width: 310px; height: 467px; border: 1px solid red;" class="rela">
           
        </div>
     <div style="width: 310px; height: 467px; border: 1px solid blue;" class="rela">
           
        </div>
       
    </body>
    </html>你运气好才弄没几天,兼容没测。。
      

  2.   

    点击查看演示代码,是需要这样的效果吗?