对话框/Tips

响应式jQuery消息通知框和信息提示框插件

阿里云

lobibox 是一款功能非常强大的 jQuery 消息通知框和信息提示框插件。这个插件分为两个部分:消息通知框和信息提示框。它能非常好的结合 Bootstrap 使用。lobibox 的消息通知框和信息提示框的特点分别是:

信息提示框:

lobibox 的信息提示框可以是模态窗口,也可以不是模态窗口

也想出现在这里?联系我们
创客主机

允许显示多条信息

允许使用任何可用的 CSS 动画(animate.css)来显示和隐藏信息提示框

信息提示框可以显示不同的颜色和图标

可以设置为确认信息提示框

可以设置为一行的 prompt 信息框。(可以使用任何 HTML5 的输入框类型来作为 prompt)

也可以设置为多重 prompt 信息框

可以在信息提示框上使用进度条

可以通过 ajax 调用来自定义信息提示框中的内容

每一条信息都是插件的一个实例对象。你可以非常容易的获取这些实例对象,并为它们附件事件会在对象中调用方法

消息通知框:

支持不同颜色的消息通知框

可以在窗口的任意角部为主显示消息通知框

可以显示消息通知框将要消失的时间进度条

可以在消息通知框上显示图片

可以在消息通知框显示时发出提示音

可以将消息通知框显示为不同的尺寸

使用方法:

lobibox 只依赖于 jQuery,Bootstrap 是可选的。使用时要引入 jQuery 和 lobibox.min.js 以及 lobibox.min.css 文件。

  1. <script src="js/jquery-1.11.2.min.js"></script>
  2. <link rel="stylesheet" href="dist/css/LobiBox.min.css">
  3. <script src="dist/js/lobibox.min.js"></script>

创建信息提示框:

  1. // Confirm
  2. Lobibox.confirm({
  3.   ... //Options
  4. });        
  5.  
  6. // Alert
  7. Lobibox.alert(
  8.   'error|success|warning|info', // Any of the following
  9.   {
  10.   ... //Options
  11.   }
  12. ); 
  13.  
  14. // Prompt
  15. Lobibox.prompt(
  16.   '', // Any HTML5 input type is valid
  17.   {
  18.   //Options
  19.   }
  20. );  
  21.  
  22. // Progress
  23. Lobibox.progress({
  24.   //Options
  25. });
  26.  
  27. // Window
  28. Lobibox.window({
  29.   //Options
  30. });

信息提示框的默认参数:

  1. // If the messagebox is larger (in width) than window's width. 
  2. // The messagebox's width is reduced to window width - 2 * horizontalOffset
  3. horizontalOffset: 5, 
  4.  
  5. width           : 600,
  6.  
  7. // Height is automatically given calculated by width
  8. height          : 'auto',  
  9.  
  10. // Show close button or not
  11. closeButton     : true,  
  12.  
  13. // Make messagebox draggable 
  14. draggable       : false,  
  15.  
  16. // Class for custom buttons
  17. customBtnClass  : 'lobibox-btn-default', 
  18.  
  19. modal           : true,
  20. debug           : false,
  21.  
  22. // Position where buttons should be aligned
  23. buttonsAlign    : 'center', 
  24.  
  25. // Close messagebox on Esc press
  26. closeOnEsc      : true,  
  27.  
  28. //Overriding default options
  29. Lobibox.base.DEFAULTS = $.extend({}, Lobibox.base.DEFAULTS, {
  30.   //override any options from default options
  31. });

信息提示框的可用参数:

  1. Lobibox.base.OPTIONS = {
  2.  
  3. // DO NOT change this value. 
  4. // Some functionality is depended on it
  5. bodyClass       : 'lobibox-open',
  6.  
  7. // DO NOT change this object. 
  8. // Some functionality is depended on it
  9. modalClasses : {
  10.     'error'     : 'lobibox-error',
  11.     'success'   : 'lobibox-success',
  12.     'info'      : 'lobibox-info',
  13.     'warning'   : 'lobibox-warning',
  14.     'confirm'   : 'lobibox-confirm',
  15.     'progress'  : 'lobibox-progress',
  16.     'prompt'    : 'lobibox-prompt',
  17.     'default'   : 'lobibox-default',
  18.     'window'    : 'lobibox-window'
  19. },
  20.  
  21. // This is option how buttons can be shown. 
  22. // What are buttonsAlign option available values
  23. buttonsAlign: ['left', 'center', 'right'],
  24.  
  25. // You can change the title or class of buttons from here or use the same structure object for button when creating messagebox
  26. // closeOnClick : true will close the messagebox when clicking this type of button. 
  27. // Set it to false not to close messagebox when clicking on it
  28. buttons: {
  29.   ok: {
  30.     'class': 'lobibox-btn lobibox-btn-default',
  31.     text: 'OK',
  32.     closeOnClick: true
  33.   },
  34. cancel: {
  35.     'class': 'lobibox-btn lobibox-btn-cancel',
  36.     text: 'Cancel',
  37.     closeOnClick: true
  38.   },
  39.   yes: {
  40.     'class': 'lobibox-btn lobibox-btn-yes',
  41.     text: 'Yes',
  42.     closeOnClick: true
  43.   },
  44.   no: {
  45.     'class': 'lobibox-btn lobibox-btn-no',
  46.     text: 'No',
  47.     closeOnClick: true
  48.   }
  49. }
  50. };
  51. //Overriding default options
  52. Lobibox.base.OPTIONS = $.extend({}, Lobibox.base.OPTIONS, {
  53. ... //override any options except those above which is written "DO NOT change"
  54. });

创建消息通知框:

  1. Lobibox.notify(
  2.   // 'warning', 'info', 'success', 'error'
  3.   'warning',
  4.   {
  5.       ...
  6.   }
  7. );                    
  8. 消息通知框的默认参数
  9. // Title of notification. 
  10. // Do not include it for default title or set custom string. 
  11. // Set this false to disable title
  12. title: true,         
  13.  
  14. // normal, mini, large       
  15. size: 'normal',      
  16.  
  17. // Show animation class. (Uses animate.css)       
  18. showClass: 'flipInX',       
  19.  
  20. // Hide animation class (Uses animate.css)
  21. hideClass: 'zoomOutDown',   
  22.  
  23. // Icon of notification. 
  24. // Leave as is for default icon or set custom string
  25. icon: true,               
  26.  
  27. // Message of notification  
  28. msg: '',          
  29.  
  30. // Image source string          
  31. img: null,                
  32.  
  33. // Make notifications closable  
  34. closable: true,     
  35.  
  36. // Hide notification after this time (in miliseconds)        
  37. delay: 5000,               
  38.  
  39. // Show timer indicator 
  40. delayIndicator: true,       
  41.  
  42. // Close notifications by clicking on them
  43. closeOnClick: true,     
  44.  
  45. // Width of notification box    
  46. width: 400,      
  47.  
  48. // Sound of notification. Set this false to disable sound. 
  49. // Leave as is for default sound or set custom soud path           
  50. sound: true,                
  51.  
  52. // Place to show notification. 
  53. // Available options: "top left", "top right", "bottom left", "bottom right"   
  54. position: "bottom right"        
  55.  
  56. // Overriding default options
  57. Lobibox.notify.DEFAULTS = $.extend({}, Lobibox.notify.DEFAULTS, {
  58.     ... //override any options from default options
  59. });

消息通知框的可用参数:

  1. Lobibox.notify.OPTIONS = {
  2. 'class': 'animated-fast',
  3. soundPath: 'src/sounds/',
  4.  
  5. // 通过该参数修改消息通知框的尺寸
  6. large: {
  7.     width: 500
  8. },
  9.  
  10. // 设置为最小尺寸的消息通知框
  11. mini: {
  12.     'class': 'notify-mini'
  13. },
  14.  
  15. // Default options of different style notifications
  16. success: {
  17.     'class': 'lobibox-notify-success',
  18.     'title': 'Success',
  19.     'icon': 'glyphicon glyphicon-ok-sign',
  20.     sound: 'sound2.mp3'
  21. },
  22. error: {
  23.     'class': 'lobibox-notify-error',
  24.     'title': 'Error',
  25.     'icon': 'glyphicon glyphicon-remove-sign',
  26.     sound: 'sound4.mp3'
  27. },
  28. warning: {
  29.     'class': 'lobibox-notify-warning',
  30.     'title': 'Warning',
  31.     'icon': 'glyphicon glyphicon-exclamation-sign',
  32.     sound: 'sound5.mp3'
  33. },
  34. info: {
  35.     'class': 'lobibox-notify-info',
  36.     'title': 'Information',
  37.     'icon': 'glyphicon glyphicon-info-sign',
  38.     sound: 'sound6.mp3'
  39. }
  40. };   
  41.  
  42. //Overriding default options
  43. Lobibox.notify.OPTIONS = $.extend({}, Lobibox.notify.OPTIONS, {
  44. ... //override any options from default options
  45. });

响应式 jQuery 消息通知框和信息提示框插件

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

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

发表回复

热销模板

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

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