对话框/Tips

弹窗对话框jQuery插件

阿里云

弹窗对话框jQuery插件
这是一款 jQuery 弹窗对话框插件。该 jquery 弹窗插件可以用于做提示框,对话框,确认框等,兼容 ie8,并提供点击按钮后的回调函数调用方法,非常好用。

使用方法

在页面中引入 jquery、jquery.dialog.js 和 dialog.css 文件。

也想出现在这里?联系我们
创客主机
  1. <link rel="stylesheet" href="dialog.css">
  2. <script src="js/jquery.min.js"></script>
  3. <script src="js/jquery.dialog.js"></script>

创建一个基本的对话框,一个基本的对话框的调用方法如下。

  1. $.dialog({
  2.   content: ''这是对话框的内容'
  3. });

创建消息通知框,消息通知框有 3 个参数:

message:消息通知框显示的内容

timeout:多少毫秒后自动关闭

callback:关闭后的回调函数

  1. $.sendMsg('Notification Message', 3000, function(){
  2.   alert('close')
  3. });
  4.  
  5. // or
  6. $.sendSuccess('Success Message', 3000, function(){
  7.   alert('close')
  8. });
  9.  
  10. $.sendWarning('Warning Message', 3000, function(){
  11.   alert('close')
  12. });
  13.  
  14. $.sendError('Error Message', 3000, function(){
  15.   alert('close')
  16. });
  17.  
  18. $.sendSuccessToTop('Sticky Success Message', 3000, function(){
  19.   alert('close')
  20. });
  21.  
  22. $.sendWarningToTop('Sticky Warning Message', 3000, function(){
  23.   alert('close')
  24. });

创建确认框

  1. $.sendConfirm({
  2.   title: 'Confirm Dialog',
  3.   msg: 'Are U Sure?',
  4.   desc: 'Are U Sure to delete this entry?',
  5.   button: {
  6.     confirm: 'Okey',
  7.     cancel: 'Cancel'
  8.   },
  9.   onConfirm: function() {
  10.     console.log('Confirm');
  11.   },
  12.   onCancel: function() {
  13.     console.log('Cancel');
  14.   },
  15.   onClose: function() {
  16.     console.log('Close');
  17.   }
  18. });

配置参数

全局配置参数和默认值如下:

  1. {
  2.   id: '',
  3.   title: 'Title',
  4.   isFixed: true,
  5.   hideHeader: false,
  6.   hideClose: false,
  7.   content: null,
  8.   callback: null,
  9.   withNoPadding: false, 
  10.   withNoMinWidth: false,
  11.   bgHide: true,
  12.   escHide: true
  13. }

对话框的默认配置参数如下:

  1. {
  2.   id: 'dialogConfirmBox',
  3.   title: 'Confirm',
  4.   hideHeader: false,
  5.   hideClose: false,
  6.   withCenter: false,
  7.   withIcon: false,
  8.   autoClose: false,
  9.   timeout: 3000,
  10.   width: null, 
  11.   noconfirm: false,
  12.   msg: '',
  13.   desc: '', 
  14.   content: '', 
  15.   button: {
  16.     confirm: 'Okey', // {text:'Text', href:'#', target:'_blank',behavior:'behavior'}
  17.     cancel: 'Cancel', // {text:'Text', href:'#', target:'_blank',behavior:'behavior'}
  18.     cancelFirst: false
  19.   }
  20. }

Github 网址:https://github.com/springlong/jquery-dialog

弹窗对话框 jQuery 插件

已有 408 人购买
查看演示升级 VIP立刻购买

演示地址 下载地址
收藏
(0)

发表回复

热销模板

Ashade - 作品展示摄影相册WordPress汉化主题
LensNews

本站承接 WordPress / PbootCMS / DedeCMS 等
系统建站、仿站、开发、定制等业务!