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
     

    主机:

    端口:

  • 相关阅读:
    sqlserver 批量删除所有表语句
    C# 中的委托和事件
    Oracle建立用户
    C# Linq获取两个List或数组的差集交集
    Linux下Redis安装与配置操作说明
    word缩印
    centos7上的postgresql10安装和配置
    numpy技巧
    发票二维码扫描增强_06_持续优化
    发票二维码扫描增强_05_构建目标二维码
  • 原文地址:https://www.cnblogs.com/lwsup/p/7420388.html
Copyright © 2011-2022 走看看