javascript - 请问如何在nofity的提示框中加入按钮?

查看:129
本文介绍了javascript - 请问如何在nofity的提示框中加入按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

$.notify({
                      title: '确定要删除此模板吗!',
                      message: ""
                    },{
                      element: 'body',
                      type: 'warning',
                      placement: {
                        from: "top",
                        align: "center"
                      },
                      template: '<div data-noify="container" class="col-xs-11 col-sm-3 alert alert-{0}" role="alert">' +
                      '<button type="button" aria-hidden="true" class="close" data-notify="dismiss">×</button>' +
                      '<span data-notify="icon"></span> ' +
                      '<span data-notify="title">{1}</span> ' +
                      '<span data-notify="message">{2}</span>' +
                      '<div class="progress" data-notify="progressbar">' +
                      '<div class="progress-bar progress-bar-{0}" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;">' +
                      '<button type="button" class="btn btn-warning">确定</button>'+
                      '</div>' +
                      '</div>' +
                      '</div>'
                    });

我这样加的,但是没有反应。。
谢谢!

解决方案

template: '<div data-noify="container" class="col-xs-11 col-sm-3 alert alert-{0}" role="alert">' +
                        '<span data-notify="icon"></span> ' +
                        '<span data-notify="title">{1}</span> ' +
                        '<span data-notify="message">{2}</span>' +
                        '<div class="progress" data-notify="progressbar">' +
                        '</div>' +
                        '<br />'+
                        '<button type="button" class="btn btn-sm btn-warning confirmDel" style="margin-top:20px;">确定</button>'+
                        '<button type="button" class="btn btn-sm btn-info undelete" style="margin-top:20px; margin-left:20px;">取消</button>'+
                        '</div>'

这样设置就行

这篇关于javascript - 请问如何在nofity的提示框中加入按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆