【发布时间】:2012-06-04 23:02:22
【问题描述】:
我正在使用noty 来显示使用“右上角”警报设置的通知。我对 jquery 很陌生,但对 php 和 mysql 的了解足以完成我想做的大部分事情。
我想要做的是使用 mySQL 获取数据以查看是否需要向用户显示任何通知(完成)。然后在页面加载时显示该通知,我也这样做了,尽管我确信除了重复代码之外还有一种更优雅的方式来显示多个通知?
然后我想为每个通知的出现延迟 1 秒,这样它们就不会同时弹出并同时消失。我已经研究过 .delay() ,但对 jQuery 没有更好的了解,这对我来说毫无用处。
我的代码:
$(document).ready(function() {
var noty_id = noty({"text":"a message","layout":"topRight","type":"inormation","animateOpen":{"height":"toggle"},"animateClose":{"height":"toggle"},"speed":1000,"timeout":5000,"closeButton":false,"closeOnSelfClick":true,"closeOnSelfOver":false,"modal":false});
var noty_id = noty({"text":"a message","layout":"topRight","type":"inormation","animateOpen":{"height":"toggle"},"animateClose":{"height":"toggle"},"speed":1000,"timeout":5000,"closeButton":false,"closeOnSelfClick":true,"closeOnSelfOver":false,"modal":false});
});
【问题讨论】:
标签: php jquery mysql notifications