<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Title</title>
<style>
.hide {
display: none;
} .modal {
position: fixed;
top: 50%;
left: 50%;
width: 500px;
height: 400px;
margin-left: -250px;
margin-top: -250px;
background-color: #eeeeee;
z-index: 10;
} .shadow {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
opacity: 0.6;
background-color: black;
z-index: 9;
}
</style>
</head>
<body>
<a onclick="add();">添加</a>
<table border="1" id='ta'>
<tr>
<td id="tt" target="hostname">1.1.1.11</td>
<td target="port">80</td> <td>
<a class="edit">编辑</a> | <a class="del_model">删除</a>
</td>
</tr>
<tr>
<td target="hostname">1.1.1.12</td>
<td target="port">80</td>
<td>
<a class="edit">编辑</a> | <a class="del_model">删除</a>
</td>
</tr>
<tr>
<td target="hostname">1.1.1.13</td>
<td target="port">80</td>
<td>
<a class="edit">编辑</a> | <a class="del_model">删除</a>
</td>
</tr>
<tr>
<td target="hostname">1.1.1.14</td>
<td target="port">80</td>
<td>
<a class="edit">编辑</a> | <a class="del_model">删除</a>
</td>
</tr>
</table>
<div class="modal hide">
<div>
<input name="hostname" type="text"/>
<input name="port" type="text"/> </div>
<div>
<input type="button" value="取消" onclick="cancel();"/>
<input id="confirm" type="button" value="确定" />
</div>
</div>
<div class="shadow hide"></div>
<script src="jquery-1.12.4.js"></script>
<script>
function add() {
$(".modal,.shadow").removeClass('hide')
}
function cancel() {
$(".modal,.shadow").addClass('hide')
$('.modal input[type="text"]').val("")
// 点击取消按钮就会清空文本框的内容
} $(".edit").click(function () {
$('.modal,.shadow').removeClass('hide')
var res = $(this).parent().prevAll()
// 循环每一个td
res.each(function () {
// 获取hostname属性
var host_name = $(this).attr('target');
// 获取内容1.1.1.11
var res = $(this).text();
// $('.modal input[name="hostname"]')
// 字符串拼接
var a = '.modal input[name="';
var b = '"]'
var tmp = a + host_name + b
$(tmp).val(res) }) // .val()进行赋值
})
$('.del_model').click(function () {
$(this).parent().parent().remove(); })
function confirm_model() {
var tr = document.createElement('tr');
var td1 = document.createElement('td');
td1.innerHTML='1.1.1.1';
var td2 = document.createElement('td');
td2.innerHTML='8001';
$(tr).append(td1);
$(tr).append(td2);
$('#ta').append(tr);
$(".modal,.shadow").addClass('hide'); } </script>
</body>
</html>

python :模态对话框的更多相关文章

  1. MFC编程 | 非模态对话框的定义

    因为课程需要,会用到MFC编程,所以讲一些经验总结下,以便日后使用查询. // 非模态对话框的定义 // 通过单文档菜单调用一个非模态窗口 1.首先在工程里插入一个对话框(如:IDD_DLG_TEST ...

  2. bootstrap dialog 使用模态对话框

    bootstrap3-dialog 使用模态对话框 <div class="modal fade"> <div class="modal-dialog& ...

  3. 【原创】WinForm 模态对话框

    今天解决的一个问题,记录下,以备后用. 问题描述:WinForm程序有超时自动退出功能,但是有些模态对话框不关掉的话会退出失败,原因(猜测): 程序倒计时用的System.Windows.Forms. ...

  4. 关于easyUI的模态对话框

    本文版权归博客园和作者吴双本人共同所有,转载和爬虫请注明原文地址.博客园蜗牛cnblogs.com/tdws 会用easyUI的模态对话框会是我们的开发更加简洁,只需下载这个插件,把需要的文件拖到项目 ...

  5. 自定义AlertView实现模态对话框

    在Windows应用程序中,经常使用模态(Model)对话框来和用户进行简单的交互,比如登录框.在IOS应用程序中,有时我们也希望做同样的事情.但IOS的UI库中,没有模态对话框,最接近那个样子的应该 ...

  6. MFC编程入门之十二(对话框:非模态对话框的创建及显示)

    上一节讲了模态对话框及其弹出过程,本节接着讲另一种对话框--非模态对话框的创建及显示. 非模态对话框显示后,程序其他窗口仍然能正常运行,可以响应用户输入,还可以相互切换.上一讲中创建的Tip模态对话框 ...

  7. MFC编程入门之十一(对话框:模态对话框及其弹出过程)

    加法计算器对话框程序大家照着做一遍后,相信对基于对话框的程序有了些解了,有个好的开始对于以后的学习大有裨益.趁热打铁,这一节讲讲什么是对话框和非模态对话框,以及模态对话框怎样弹出. 一.模态对话框和非 ...

  8. MFC学习笔记(一)向模态对话框传递数据

    声明构造函数为2个参数,具有默认参数的参数须放在后面. CDialogDimmer::CDialogDimmer(CString name,CWnd* pParent /*=NULL*/) : CDi ...

  9. Unity3D 调用模态对话框/Unity3D MessageBox

    Unity模态对话框/Unity MessageBox 很多时候,我们需要将Unity的exe产品发布到某一个平台.比如某某斗地主发布到某Q游戏.这时候如果需要调试肿么办.办法无外乎那几个.1:源码调 ...

随机推荐

  1. Thinking in Java——笔记(14)

    Type Information The need for RTTI Because it is a dynamically bound method, the proper behavior wil ...

  2. 一起来做chrome扩展《AJAX请求》

    chrome在一次更新之后,出于安全考虑,完全的禁止了content_script从https向http发起ajax请求,即使正常情况下也会在console里给出提示.这对于WEB来讲是好事,但对于扩 ...

  3. git review出现的问题

    在提交代码review的时候可能会出现 Could not connect to gerrit.Enter your gerrit username: xxxxTrying again with ss ...

  4. 出售一套Unity ARPG手游源码

    项目已经上线,在越南App Store曾经排名第一.客户端Unity C#开发,Android可以热更新,IOS可以更新资源,服务器 C++ + lua开发,文档齐全,欢迎咨询. QQ:7734952 ...

  5. SQL学习整理_1

    数据库是保存表和其他相关SQL结构的容器. 列是存储在表中的一块同类型数据. 行是一组能够描述某个事物的列的集合. SQL不区分大小写,但建议命令采用大写,表名采用小写,便于读写. 建立数据库 CRE ...

  6. openfire xmpp 登录参数解析

    1.openfire xmpp登录 boolean result = false; ConnectionConfiguration config = new ConnectionConfigurati ...

  7. JMeter学习-034-JMeter调试工具之一---HTTP Mirror Server

    通常,编程工具IDE都提供了相应的调试模块,供开发者使用,以便更快速的定位问题所在.那么在JMeter编写测试脚本的过程中,JMeter都提供了哪些调试工具供我们使用呢? JMeter常用的调试工具有 ...

  8. oracle sqlplus 格式化输出

    1- show pagesize      ###显示页行数 set pagesize 300 ###显示页行数为300 2- show linesize        ###显示行宽度 set li ...

  9. [SharePoint 2010] Copy list item with version history and attachment

    private void MoveItem(SPListItem sourceItem, SPListItem destinationItem) { if (sourceItem == null || ...

  10. spring定时任务

    需求:在tomcat启动时开启一个定时任务,即项目启动完成后,自动执行某一特定任务. 想法:容器启动时执行方法,最容易想到的就是servlet中可以配置load-on-startup,设置一个正整数也 ...