来自于《jquery权威指南》

-------------------

点击删除时,弹出提示框,并做相应的删除确定或取消

完整代码如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jQuery</title>
<style type="text/css">
body,div,ul,li{margin: 0;padding: 0; font-size: 13px;}
ul{list-style-type: none;}
.divShow{line-height: 32px;height: 32px;background-color: #eee;width: 280px;padding-left: 10px;}
.divShow span{padding-left: 50px;} .dialog{width: 360px;border: solid 5px #666;position: absolute;display: none;z-index: 101;}
.dialog .title{background-color: #fbaf15;padding: 10px;color: #fff;font-weight: bold;}
.dialog .title img{float: right;}
.dialog .content{background-color: #fff;padding: 25px;height: 60px;}
.dialog .content img{float: left;}
.dialog .content span{float: left;padding-top: 10px;padding-left: 10px;}
.dialog .bottom{text-align: right;padding: 10px 10px 10px 0;background-color: #eee;}
.mask{width: 100%;height: 100%;background-color: #000;position: absolute;top: 0px;left: 0px;filter:alpha(opacity=30);opacity:0.3;display: none;z-index: 100;}
.btn{border: solid 1px #666;padding: 2px;width: 65px;filter:progid:DXImageTransform:Microsoft.Gradient(GradientType=0,StartColorStr=#fff,EndColorStr=#ECE9D8);} </style>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript"> $(function(){
$("#btn1").click(function(){
$(".mask").show();
showDialog();
$(".dialog").show();
}); function showDialog(){
var objW = $(window);
var objC = $(".dialog");
var brsW = objW.width();
var brsH = objW.height();
var sclL = objW.scrollLeft();
var sclT = objW.scrollTop();
var curW = objC.width();
var curH = objC.height();
var left = sclL + (brsW - curW) /2;
var top = sclT + (brsH - curH) /2;
objC.css({"left":left,"top":top});
} $(window).resize(function(){
if(!$(".dialog").is(":visible")){
return;
}
showDialog();
}); $(".title img").click(function(){
$(".dialog").hide();
$(".mask").hide();
}); $("#btn3").click(function(){
$(".dialog").hide();
$(".mask").hide();
}); $("#btn2").click(function(){
$(".dialog").hide();
$(".mask").hide();
if($("input:checked").length != 0){
$(".divShow").remove();
}
}); }); </script>
</head>
<body> <div class="divShow">
<input type="checkbox" id="chb1" />
<a href="#">可以删除的记录</a>
<span><input id="btn1" type="button" value="删除" class="btn" /></span>
</div>
<div class="mask"></div>
<div class="dialog">
<div class="title"><img src="data:images/close.gif" alt="">删除时提示</div>
<div class="content"><span>是否确定删除该记录?</span></div>
<div class="bottom">
<input id="btn2" type="button" value="确定" class="btn" />
<input id="btn3" type="button" value="取消" class="btn" />
</div>
</div> </body>
</html>

jquery删除记录弹出提示框的更多相关文章

  1. js+jquery手写弹出提示框

    <!doctype html> <html> <head> <meta charset="utf-8"> <title> ...

  2. c# web 删除时弹出提示框

    方法1: 在控件中增加属性 <asp:Button ID="btnSub" runat="server" Text="提交" oncl ...

  3. 基于Jquery 简单实用的弹出提示框

    基于Jquery 简单实用的弹出提示框 引言: 原生的 alert 样子看起来很粗暴,网上也有一大堆相关的插件,但是基本上都是大而全,仅仅几句话可以实现的东西,可能要引入好几十k的文件,所以话了点时间 ...

  4. jQuery - 选中复选框则弹出提示框

    <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...

  5. android标题栏下面弹出提示框(一) TextView实现,带动画效果

    产品经理用的是ios手机,于是android就走上了模仿的道路.做这个东西也走了一些弯路,写一篇博客放在这里,以后自己也可用参考,也方便别人学习. 弯路: 1.刚开始本来用PopupWindow去实现 ...

  6. [转] 在Asp.net前台和后台弹出提示框

    一.在前台弹出提示框 1.点击"A"标记或者"控件按钮"弹出提示框 <asp:LinkButton ID="lbtnDel" runa ...

  7. SilverLight 页面后台方法XX.xaml.cs 创建JS,调用JS ,弹出提示框

    1.Invoke和InvokeSelf [c-sharp] view plaincopy public partial class CreateJSDemo : UserControl { publi ...

  8. android标题栏上面弹出提示框(二) PopupWindow实现,带动画效果

    需求:上次用TextView写了一个从标题栏下面弹出的提示框.android标题栏下面弹出提示框(一) TextView实现,带动画效果,  总在找事情做的产品经理又提出了奇葩的需求.之前在通知栏显示 ...

  9. PHP弹出提示框并跳转到新页面即重定向到新页面

    本文为大家介绍下使用PHP弹出提示框并跳转到新页面,也就是大家所认为的重定向,下面的示例大家可以参考下   这两天写一个demo,需要用到提示并跳转,主要页面要求不高,觉得没必要使用AJAX,JS等, ...

随机推荐

  1. Java垃圾回收原理

    无意中在网络上找到了这篇介绍垃圾回收机制的文章,好文!转一下: 垃圾回收器是如何工作的?我现在就简单的介绍一下 首先要明确几点: Java是在堆上为对象分配空间的 垃圾回收器只跟内存有关,什么IO啊, ...

  2. FPGA设计中的float

    在通常的设计中,不建议使用浮点数计算,因为浮点数计算会消耗FPGA大量的逻辑单元.但很多情况下,又需要使用浮点数进行计算提高精度. 所以需要有合适的方法计算浮点运算. 正常情况下FPGA只能以整形数据 ...

  3. 5月22日上课笔记-js属性选择器、过滤选择器、鼠标事件

    一.属性选择器 [attr] 包含属性 [attr=value] 属性值 [attr!=value] 属性值不等于value [attr^=value] 属性值以value开头 [attr$=valu ...

  4. Long.parseLong(String s) 其中s必须是数字形式的字符串,才能运用该函数转化为长整型。

    public class ConverTo { public static void main(String [] args) { String numberIn =args[0]; convertN ...

  5. nginx与tomcat整合

    nginx与tomcat整合   1. 在/usr/local/nginx/conf下面添加文件proxy.conf # cat /usr/local/nginx/confg/proxy.conf p ...

  6. JAVA线程分析定位排查

    java开发中有的时间经常遇到某个线程消耗CPU高的问题,但是不清楚这个线程在做什么. 于是网上看了一些文章,找到了一个比较靠谱的办法(Linux下,Windows同理) : 首先使用top确认是否消 ...

  7. MySQL编码问题(无法插入中文)

    1.问题描述 2.解决方案 1.问题描述 当使用django时,如果数据库是MySQL,插入中文会报错: Incorrect string value: '\xF0\x9F...' for colum ...

  8. python3.5+flask+mysql

    该篇博客配置环境为:python版本3.5,flask2.0,python3中已经不再支持MySQLdb模块,所有这里我用了pymysql,所有使用前应该 安装pymysql:pip install ...

  9. Python 小知识点(10)--异常结构记录

    try: print("try中") except KeyError as e: # 异常时,执行该块 print("异常中") else: # 主代码块(tr ...

  10. 说说JDK中的List-ArrayList、Vector、LinkedList

    为方便开发人员,JDK提供了一套主要数据结构的实现,比如List.Map等.今儿说说List接口. List接口的一些列实现中,最常用最重要的就是这三个:ArrayList.Vector.Linked ...