我正在使用notifyjs进行一些通知.我注意到.notify(...)返回一个元素,而不是我可以用来操纵通知的对象.如何隐藏来自外部事件的通知,例如单击按钮?
是否有可能以某种方式在通知中注入元素ID或类名,所以我可以稍后使用jQuery选择它?现在我所看到的是:
<div class="notifyjs-wrapper">
<div class="notifyjs-arrow" style="..."></div>
<div class="notifyjs-container" style="...">
<div class="notifyjs-bootstrap-base notifyjs-bootstrap-info">
<span data-notify-text="">No Pick Tickets To Create</span>
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
我没有具体的具体内容可以用于以后识别通知.按照notifyjs页面上的一个例子,我试图:
$('#elem').notify({
title: $('<div id="foobar"></div>').text("the message")
}, {
...
});
Run Code Online (Sandbox Code Playgroud)
但这会导致通知中断.
我在我的document.ready上有以下代码
$.notify("Your class starts in 15min", "info", {
clickToHide: false,
autoHide: false,
globalPosition: 'top center'
});
Run Code Online (Sandbox Code Playgroud)
但没有任何反应,我只得到文本和信息类型,但自动隐藏和globalposition它不起作用.
我做错了什么.
谢谢你的帮助