HTML #模态对话框 (完成版)

摘要:
DOCTYPE html˃title。c1{背景颜色:灰色;位置:固定;顶部:0;左侧:0;右侧:0;底部:0;容量:1;}。c2{背景色:白色;位置:固定;顶部:50%;左侧:50%;高度:300px;宽度:626px;顶部边距:-150px;左侧边距:-400px;}。c3{color:#000;}。side{display:none;}主机名IP端口配置12localhost1.1.1.18080localhost1.1.1.23306˃localhost1.1.1.380$.click;$。单击;$。单击ps:您可以复制过去的测试。

###

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .c1{
            background-color: gray;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            opacity: 1;
        }
        .c2{
            background-color: white;
            position: fixed;
            top: 50%;
            left: 50%;
            height: 300px;
            width: 626px;
            margin-top: -150px;
            margin-left: -400px;
        }
        .c3{
            color: #000;
        }
        .hide{
            display: none;
        }
    </style>
</head>
<body>
    <input id="i1" type="button" value="添加">
    <table border="1px">
        <thead>
            <tr>
                <th>主机名</th>
                <th>IP</th>
                <th>端口</th>
                <th>配置</th>
            </tr>
        </thead>
        <tbody>
            <div id="i2" class="c1 hide">12</div>
            <tr>
                <td>localhost</td>
                <td>1.1.1.1</td>
                <td>8080</td>
                <td><input class="c3" type="button" value="编辑"><input type="button" value="删除"></td>
            </tr>
            <tr>
                <td>localhost</td>
                <td>1.1.1.2</td>
                <td>3306</td>
                <td><input class="c3" type="button" value="编辑"><input type="button" value="删除"></td>
            </tr>
            <tr>
                <td>localhost</td>
                <td>1.1.1.3</td>
                <td>80</td>
                <td><input class="c3" type="button" value="编辑"><input type="button" value="删除"></td>
            </tr>
        </tbody>
        <div id="i3" class="c2 hide">
            <div id="i4">
                <input type="text" name="hostname" />
                <input type="text" name="ipaddr" />
                <input type="text" name="port"/>
            </div>
            <input type="button" value="取消">
            <input type="button" value="确定">
        </div>
    </table>
    <script src="jquery-3.2.1.js"></script>
    <script>
        $('#i1').click(function () {
            $('#i2,#i3').removeClass('hide');

        });
        $("input[value='取消']").click(function () {
            $('#i2,#i3').addClass('hide');
            $(".c2 input[type='text']").val('');

            });
        $('.c3').click(function () {
            var h = $('#i2,#i3').removeClass('hide');
            tds = $(this).parent().siblings();
            var hostname = $(tds[0]).text();
            var ipaddr = $(tds[1]).text();
            var port = $(tds[2]).text();
//            console.log(hostname,ipaddr,port);
//            var v1 = $('#i4').children("input[name='hostname']").val(hostname);
//            var v2 = $('#i4').children("input[name='ipaddr']").val(ipaddr);
//            var v3 = $('#i4').children("input[name='port']").val(port);
            var v1 = $(".c2 input[name='hostname']").val(hostname)
            var v2 = $(".c2 input[name='ipaddr']").val(ipaddr);
            var v3 = $(".c2 input[name='port']").val(port);
        })
    </script>
</body>
</html>

 ps:大家可以复制过去测试下。

静态效果图:

12 ###

主机名IP端口配置
localhost1.1.1.18080
localhost1.1.1.23306
localhost1.1.1.380

免责声明:文章转载自《HTML #模态对话框 (完成版)》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇应用程序框架实战十三:DDD分层架构之我见Linux环境下JDK/Eclipse一键安装脚本下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

随便看看

计算显卡对比

科学计算显卡的几个主要性能指标:1.计算能力:每秒FLOPS浮点运算,TFLOPS代表每秒万亿次浮点运算;2.计算性能:3.视频内存大小:视频内存大小还决定了可以用于实验的样本数量和模型的复杂性。...

OpenWrt上搭建纯L2TP服务器[ZT]

转移自:http://www.openwrt.pro/post-389.html纯L2TP(L2TP+ppp,无IPSec)首先安装xl2tpd软件包opkgupdateopkginstallxl2tpd edit/etc/xl2tpd/xl2tpd。conf,并配置l2tp服务器[global]port=1701authfile=/etc/xl2tpd/x...

Debian 命令行方式配置网络

确保未在文件/etc/network/interfaces中手动配置网络,即应删除上述1和2中配置的内容。打开nmtui的图形界面并直接进行配置。当然,您也可以在此处设置无线连接。...

浪潮各机型管理芯片BMC IP(智能平台管理接口)设置

NF5240m3/NF5140m3/NF5280m3/SA5212H2/NP5540M3NF5270M3/NF5170M3/NF8420m3IPMI主板集成管理芯片BMCIP设置开机按DEL键进入BIOS设置选择"ServerMgmt"---"BMCNetworkConfiguration"---"lanchannel1/2"---"staticipaddr...

将txt、csv等文本文件导入Hive

将txt、csv等文本文件导入Hive目录将txt、csv等文本文件导入Hive00.数据在虚拟机外01.启动hadoop、hdfs02.将文件放置在hdfs目录下03.登录hive并进入指定数据库04.根据文件创建表05.执行导入语句00.数据在虚拟机外如果数据在虚拟机内,请跳过此步,直接执行接下来的操作。...

windows 常用命令行操作

目录操作˃pwd打印当前工作目录,通过此关键词可以查看当前所处的路径˃cd更改目录,用于多个目录之间的切换具体输入:cd目录名cd目录名/子目录名(可通过此方式到达最底层的目录)cd~(返回home目录)cd..(返回上一级目录)cd../..(返回上两级目录)cd盘符名:(不同盘符间跳转,cd后面跟上路径则可实现精准跳转)˃mkdir创建目录具体输入:mk...