zoukankan      html  css  js  c++  java
  • div对话框

    <!DOCTYPE html>  
    <html lang="en">  
    <head>    
    <meta charset="UTF-8">  
    <title>div对话框</title>  
        <style type="text/css">    
            #dialog    
            {    
                display:none;    
                border:1px solid #ddd;    
                height:600px;    
                900px;    
                position:fixed;   
                top:50%;  
                left:50%;    
                margin-top: -300px;   
                margin-left: -450px;  
                z-index:2;  
                background: #f8f8f8;    
            }    
        </style>    
    </head>    
    <body style="height: 1500px;">    
        <button id="open">弹出</button>  
        <div id="dialog">    
            <button id="close" style="float: right;">X</button>  
            <div></div>    
        </div>    
        <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.js"></script>  
        <script type="text/javascript">    
            $(function () {  
                $('#open').click(function () {  
                    show();  
                });  
                $('#close').click(function() {  
                    hide();  
                })  
                var dialog = $('#dialog');    
                function show()    
                {    
                    dialog.css({'display': 'block'});  
                }    
                function hide()    
                {    
                    dialog.css({'display': 'none'});  
                }    
            });  
    
        </script>    
    </body>    
    </html>    


  • 相关阅读:
    structInMemory
    合并字符串
    eggs
    1005. Spell It Right (20) -PAT
    60 人工智能
    50 计算机网络
    20数据结构
    40操作系统
    10 C/C++/python
    30汇编
  • 原文地址:https://www.cnblogs.com/xutongbao/p/9924946.html
Copyright © 2011-2022 走看看