Toastr js添加批准/拒绝按钮

4
我正在尝试设置Toastr js,使其成为一种对话框按钮。
我只需要在我的Toastr消息上有一个"批准"和一个"驳回"按钮。
toastr.options = {
    "closeButton": true,
    "debug": false,
    "positionClass": "toast-bottom-left",
    "onclick": null,
    "showDuration": "1000",
    "hideDuration": "1000",
    "timeOut": "5000",
    "extendedTimeOut": "1000",
    "showEasing": "swing",
    "hideEasing": "linear",
    "showMethod": "fadeIn",
    "hideMethod": "fadeOut"
}
toastr.info("Do you wish to continue");

有人知道这是否可行,或者知道其他允许我做到这一点的脚本吗?

请注意:

我知道可以使用模态框来实现,但我想尝试避免它。

2个回答

6

1
你可以为toastr js添加按钮。
例如,单击一个“确定”按钮可以清除toastr:
toastr.info('message <button type="button" class="btn clear btn-toastr" onclick="toastr.clear()">OK</button>' , 'Studio Message:');

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接