【问题标题】:Toastr js add aprove / disaprove buttonToastr js 添加批准/不批准按钮
【发布时间】:2014-06-26 10:51:41
【问题描述】:

我正在尝试将 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");

有谁知道这是否可能或知道任何其他允许我这样做的脚本?

请注意

我知道这可以通过 Modal 完成,但我想尝试避免它。

【问题讨论】:

    标签: javascript dialog toastr


    【解决方案1】:

    当然。您可以将任何您想要的 HTML 添加到 toast,然后将事件处理程序连接到它。有关更多详细信息和示例,请参阅演示。 http://codeseven.github.io/toastr/demo.html

    【讨论】:

      【解决方案2】:

      您可以为 toastr js添加按钮

      例如,单击ok 的按钮以清除toastr

      toastr.info('message <button type="button" class="btn clear btn-toastr" onclick="toastr.clear()">OK</button>' , 'Studio Message:');
      

      【讨论】:

        猜你喜欢
        • 2021-11-18
        • 1970-01-01
        • 1970-01-01
        • 2011-08-28
        • 2019-10-23
        • 1970-01-01
        • 1970-01-01
        • 2022-08-20
        • 1970-01-01
        相关资源
        最近更新 更多