码迷,mamicode.com
首页 > Web开发 > 详细

jquery 弹出层

时间:2016-07-14 19:14:38      阅读:296      评论:0      收藏:0      [点我收藏+]

标签:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
    </head>
   <script src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>
    <style type="text/css">
        #more{
            text-decoration: none;
            color: deepskyblue;
            cursor: pointer;
        }
        #div{
            z-index: 19891016;
            width: 360px;
            height: 240px;
            top: 30.5px;
            left: 400px;
            margin: 0;
            padding: 0;
            background-color: #ffffff;
            box-shadow: rgba(0, 0, 0, 0.298039) 1px 1px 50px;
            border-radius:3px;
            display: none;
        }
        #close{
            padding:11px;
            width: 40px;
            height: 20px;
            cursor: pointer;
            float: right;
            color: #000;
            display: block;
        }
        #shade {
            z-index: 19891015;
            background-color: #bdbdbd;
            top: 0px;
            left: 0px;
            width: 100%;   
            height: 100%;   
            position: fixed;
            display: none;
        }
        #shade,  #div {
            position: fixed;
            pointer-events: auto;
        }
    
    </style>
    <body>
        <a id="more" onclick="showDiv(‘ssddddddddd‘);" >查看更多 </a>
        <div id="shade" >
            <div id="div" class="layui-layer layer-anim" times="2" showtime="0"  >
                <span id="close" style="color:#000;" onclick="hideDiv();">
                    关闭
                </span>
                </br>
                <p id="content" style="color:#000; padding:15px;"> </p>
            </div>
        </div>
    </body>
    <script>
       function showDiv(content) {   
            $(‘#shade‘).css(‘display‘,‘block‘); 
            $(‘#div‘).css(‘display‘,‘block‘); 
            $(‘#content‘).html(content);               
        }   
        function hideDiv(div_id) {   
            $(‘#shade‘).css(‘display‘,‘none‘); 
            $(‘#div‘).css(‘display‘,‘none‘); 
            $(‘#content‘).html(‘‘);
        }
    </script>
<html>
技术分享

 

jquery 弹出层

标签:

原文地址:http://www.cnblogs.com/wangdaijun/p/5671270.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!