【问题标题】:JQX Notification Widget showing multiple messages显示多条消息的 JQX 通知小部件
【发布时间】:2020-04-15 06:53:28
【问题描述】:

目前我正在使用 jqx 通知小部件,单击代码下方的按钮将执行该小部件。但问题是当我们点击一​​个按钮时它会显示多条消息。当我们单击该按钮时,我想将其限制为单个通知。一旦它消失并且用户单击该按钮,它应该会显示该消息。

$('#dialog').after("<div id = 'jqxNotification' style='display: none;'>Saved Successfully.</div>");
$("#jqxNotification").jqxNotification({ width: 250, position: "top-right", opacity: 0.9,
        autoOpen: true, animationOpenDelay: 800, autoClose: true, template: "success"
});

【问题讨论】:

    标签: jquery jqxwidgets


    【解决方案1】:

    这里有一些提示

    没有任何设置可以做到这一点,但你可以做的是
    在打开显示通知之前隐藏所有以前的所有通知属性.jqxNotification("closeAll")

    function showMessage() {
       $("#jqxNotification").jqxNotification("closeAll");
       $('#dialog').after("<div id = 'jqxNotification' style='display: none;'>Saved Successfully.</div>");
    
       $("#jqxNotification").jqxNotification({ width: 250, position: "top-right", opacity: 0.9,
            autoOpen: true, animationOpenDelay: 800, autoClose: true, template: "success"
       });
    }
    
    showMessage()
    setTimeout(showMessage,1000);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-09-19
      • 2018-01-21
      • 2021-04-13
      • 1970-01-01
      相关资源
      最近更新 更多