bootbox自定义dialog、confirm和alert样式
2016-04-20 00:00
459 查看
摘要: bootbox自定义dialog、confirm和alert样式
$(document).ready(function() { //bootbox.setDefaults({ /** * @optional String * @default: en * which locale settings to use to translate the three * standard button labels: OK, CONFIRM, CANCEL */ //locale: "fr", /** * @optional Boolean * @default: true * whether the dialog should be shown immediately */ //show: true, /** * @optional Boolean * @default: true * whether the dialog should be have a backdrop or not */ //backdrop: true, /** * @optional Boolean * @default: true * show a close button */ //closeButton: true, /** * @optional Boolean * @default: true * animate the dialog in and out (not supported in < IE 10) */ //animate: true, /** * @optional String &nb 3ff0 sp; * @default: null * an additional class to apply to the dialog wrapper */ //className: "my-modal" //}); }); $(document).on("click", "#test", function(e) { bootbox.confirm("Hello world!", function (result) { if(result) { alert('点击了确认按钮'); } else { alert('点击了取消按钮'); } }); bootbox.dialog({ message: "I am a custom confirm", title: "Confirm title", buttons: { Cancel: { label: "Cancel", className: "btn-default", callback: function () { alert("Cancel"); } } , OK: { label: "OK", className: "btn-primary", callback: function () { alert("OK"); } } } }); bootbox.confirm({ buttons: { confirm: { label: '我是确认按钮', className: 'btn-myStyle' }, cancel: { label: '我是取消按钮', className: 'btn-default' } }, message: '提示信息', callback: function(result) { if(result) { alert('点击确认按钮了'); } else { alert('点击取消按钮了'); } }, //title: "bootbox confirm也可以添加标题哦", }); bootbox.alert({ buttons: { ok: { label: '我是ok按钮', className: 'btn-myStyle' } }, message: '提示信息', callback: function() { alert('关闭了alert'); }, title: "bootbox alert也可以添加标题哦", }); });
相关文章推荐
- DWZ刷新dialog解决方法
- js中confirm实现执行操作前弹出确认框的方法
- alert中断settimeout计时功能
- confirm的用法示例用于按钮操作时确定是否执行
- Js,alert出现乱码问题的解决方法
- MC Dialog js弹出层 完美兼容多浏览器(5.6更新)
- js Dialog 去掉右上角的X关闭功能
- jquery BS,dialog控件自适应大小
- jQuery EasyUI Dialog拖不下来如何解决
- jquery ui dialog实现弹窗特效的思路及代码
- JQUERY dialog的用法详细解析
- 使用jQuery实现更改默认alert框体
- 自编jQuery插件实现模拟alert和confirm
- jquery ui dialog替代confirm实例分析
- 基于jquery ui的alert,confirm方案(支持换肤)
- 禁止iframe页面的所有js脚本如alert及弹出窗口等
- jQuery实现dialog设置focus焦点的方法
- Java开发GUI之Dialog弹出窗口
- Bootstrap响应式前端框架笔记十六——模态框交互
- 自定义实现js的confirm方法