Jquery plugins 发生下一个错误时关闭noty error弹出窗口

Jquery plugins 发生下一个错误时关闭noty error弹出窗口,jquery-plugins,noty,Jquery Plugins,Noty,易建联希望诺蒂关闭“老”的诺蒂弹出窗口,它们仍然在屏幕上 版本2.3.7(无法更新到3.2或4.x,但这是另一个问题) 与杀手、maxVisible、force和dismissQueue的任意组合一起玩,但没有结果 function notyErrorMsg(errorMsg) { console.log("notyErrorMsg(): "+errorMsg); n = noty({text: errorMsg,

易建联希望诺蒂关闭“老”的诺蒂弹出窗口,它们仍然在屏幕上

版本2.3.7(无法更新到3.2或4.x,但这是另一个问题)

与杀手、maxVisible、force和dismissQueue的任意组合一起玩,但没有结果

function notyErrorMsg(errorMsg) {
         console.log("notyErrorMsg(): "+errorMsg);
         n = noty({text: errorMsg, 
                       buttons: [
                                 { addClass:   'btn btn-danger',
                                       text:   'Close', 
                                    onClick:   function($noty) {
                                                  $noty.close();
                                               }
                                 }
                                ],
                       layout:       "center",         
                         type:       "error",
                        theme:       "defaultTheme",
                      timeout:       30000,
                       killer:       false,
                   maxVisible:       1,
                        force:       true,
                 dismissQueue:       true
                      }
         );
         logError(errorMsg);
      }
旧的noty弹出窗口应该关闭,但它们仍然处于打开状态,必须由用户关闭。

请注意 您应该使用
n.close()
$.noty.close(n.id)
关闭noty。在您的用例中,尝试使用
this.close()
关闭noty,或在noty函数之外使用close函数 但用户仍然可以通过单击消息关闭V2中的noty