zoukankan      html  css  js  c++  java
  • HTML#模态对话框(简单版)

    ####

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
        <style>
            .c1{
                background-color: gray;
                height: 800px;
                position: fixed;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                opacity:0.6;
            }
            .c2{
                background-color: white;
                height: 300px;
                 300px;
                position: fixed;
                left:50%;
                top:50%;
                margin: -150px;
    
    
            }
            .hide{
                display: none;
            }
        </style>
    </head>
    <input type="button" value="添加主机" onclick="ShowModel()">
    <body>
        <table>
            <thead>
                <tr>
                    <th>
                        主机
                    </th>
                    <th>
                        端口
                    </th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>
                        1.1.1.1
                    </td>
                    <td>
                        8080
                    </td>
                </tr>
                <tr>
                    <td>
                        1.1.1.2
                    </td>
                    <td>
                        3306
                    </td>
                </tr>
            </tbody>
        </table>
        <div id="i1" class="c1 hide"></div>
        <div id="i2" class="c2 hide">
            <P>主机:<input type="text" placeholder="IP"></P>
            <P>端口:<input type="text" placeholder="PORT"></P>
            <input type="button" value="取消" onclick="CancleShowModel()">
            <input type="button" value="确定">
        </div>
        <script>
            function ShowModel(){
                document.getElementById('i1').classList.remove('hide')
                document.getElementById('i2').classList.remove('hide')
            }
            function CancleShowModel(){
                document.getElementById('i1').classList.add('hide')
                document.getElementById('i2').classList.add('hide')
            }
        </script>
    </body>
    </html>

    ####

    效果:

    主机端口
    1.1.1.1 8080
    1.1.1.2 3306
     

    主机:

    端口:

  • 相关阅读:
    linux 笔试题
    shell -Z- d等等代表
    shell中for循环总结
    linux启动过程
    linux面试题3
    linux面试题2
    小峰servlet/jsp(4)EL表达式
    小峰servlet/jsp(3)登陆功能实现
    小峰servlet/jsp(2)
    java日期比较例子等...
  • 原文地址:https://www.cnblogs.com/lwsup/p/7420388.html
Copyright © 2011-2022 走看看