【问题标题】:Noty not display message after some clicks一些点击后Noty不显示消息
【发布时间】:2019-02-12 19:15:23
【问题描述】:

我正在使用 noty https://ned.im/noty/

这是我的代码:

<script>
function showNoty() {
var n = new Noty({
        text: "<?php echo $message; ?>",
        type: "error", 
        layout: "top",
        theme:"sunset",
        container: "#content",
        closeWith:[]
    });
    n.show();
}
showNoty();
</script>

问题:

在第 6 次单击按钮以显示消息之前,一切正常。 所以,我可以点击 5 次并正确显示消息,而在 +6 上点击不再起作用。

有人可以给点建议吗? 谢谢!

【问题讨论】:

  • $message 来自哪里?我不知道“noty”,所以我在那里帮不上忙。检查您的控制台并使用错误报告。如果这与 db 相关,请检查错误和您使用的代码。
  • 我认为您需要检查 Noty 的 maxVisible 值。参考:ned.im/noty/#/api?id=api-static-methods。所有队列的默认 maxVisible 值为 5。

标签: javascript php jquery noty


【解决方案1】:

我需要使用静态方法(https://ned.im/noty/#/api?id=api-static-methods

我解决了这个问题:

Noty.setMaxVisible(10);

谢谢大家!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多