页面调用JS:
$(文档)。ready(function(){ $(' # delete _ with _ layer ')).单击(function(){ $。tconfim。打开({ body : '确定要删除吗?',键入: '确认',onok : function(){ alert(' yes ');}});});$('#delete_with_layer ').单击(function(){ $。tconfim。打开({重叠: true,body: '您确定要删除吗?',键入: '确认',onok : function(){ alert(' yes ');}});});$('#information ').单击(function(){ $。tconfim。打开({ body : ')这是基于图片预览的确认框!',键入:“info”,onok : function(){ alert(' yes ');}});});$(' #成功').单击(function(){ $。tconfim。打开({ body : '保存成功!',键入:“成功”,onok : function(){ alert(' yes ');}});});$(“# error”).单击(function(){ $。tconfim。打开({ body : '部分字段有误!',键入:"错误",onok : function(){ alert(' yes ');}});});$(“# warning”).点击(function(){ $。tconfim。打开({ body : '某人登录,不是真实用户!键入:“警告”,onok :函数(){ alert(' yes ');}});});});
图1。共同确认
图2。带图层的确认框
图3。错误框
图4。成功框
图5。警告框
源码下载:https://github。com/tomlxq/jquery-确认