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
     

    主机:

    端口:

  • 相关阅读:
    如何制作动态层分组报表
    填报表之数据留痕
    填报表中也可以添加 html 事件
    填报脚本之轻松搞定复杂表的数据入库
    在报表中录入数据时如何实现行列转换
    如何在报表中绘制 SVG 统计图
    如何用报表工具实现树状层级结构的填报表
    6.JAVA_SE复习(集合)
    JAVA_SE复习(多线程)
    数据库基本概念
  • 原文地址:https://www.cnblogs.com/lwsup/p/7420388.html
Copyright © 2011-2022 走看看