1

我正在使用 HumaneJs http://wavded.github.com/humane-js/来显示通知。除了我似乎无法指定应该出现通知的 DIV 之外,一切都运行良好。此链接https://github.com/wavded/humane-js/pull/32中的讨论似乎表明这是可能的,但我无法让它工作

这是我的 HTML 代码

<button id="1">Display default notification</button><br/><br/><br/><br/>

<div id="container">
    <button id="2">Display notification inside div</button><br/><br/>
</div>

这是Javascript

/*display notification in default position*/
$("#1").click(function() {
  humane.log("Default notification");
});


/*display notification inside div*/
$("#2").click(function() {
    var custom = humane.create({container: $("#container")[0]});
    custom.log("Notification inside div");
});

我还设置了一个小提琴来演示这个问题

http://jsfiddle.net/ZvCvJ/

单击按钮似乎每次都在默认位置(右上角)显示通知,我无法在 DIV 内显示通知。任何帮助,将不胜感激。

4

2 回答 2

0

Humane 中各个主题的 CSS 看起来并没有考虑到“容器”。另一个明确支持这种“容器受限”通知的通知插件是 Noty。 http://needim.github.io/noty/#custom-container

于 2013-11-25T11:32:38.230 回答
0

它显示在角落的原因是因为您使用的是默认值libnotify

添加baseCls: "humane-bigbox"它应该修复它。

http://jsfiddle.net/ThdLC/

于 2013-01-21T22:46:17.580 回答