Notify Js 在底部显示通知

Notify Js displaying notification at the bottom

我正在使用 notify.js 插件在我的网站上显示通知。

https://notifyjs.com/

根据文档,它说默认情况下通知将显示在右上角。 通知以某种方式显示在底部。

通过 notify.js 中的代码时,它在 body.So 末尾附加了 div 元素,我将其更改为前置,但通知仍显示在底部.

anchor.css(css).addClass(pluginClassName + "-corner");
$("body").append(anchor);

发生这种情况的原因是什么?我应该调试的任何指针? 我用来通知的代码是:

$.notify("Name cannot be empty!","error");

据我所知,当插件被实例化时,一个 DOM 元素被附加到正文中:

<div class="notifyjs-corner" style="top: 0px; right: 0px;"></div>

所有通知都在此 DOM 元素内创建。

规则 notifyjs-corner 的原始定义是:

.notifyjs-corner {
    position: fixed;
    margin: 5px;
    z-index: 1050;
}

您应该检查是否不小心覆盖了 CSS 规则。

尝试查找并检查 DOM 元素。

以下方法通过重新定义页面的默认设置:

$.notify.defaults({globalPosition: 'top left'})

在这种情况下可能会有帮助。