Notify.js是一个jQuery插件,提供简单但完全可自定义的通知。
基本用法
1.元素通知
您可以在任何元素上放置通知:
$(".elem-demo").notify("Hello Box");
2.全局通知
如果您未指定元素,则通知将显示在左上角(除非您指定了其他位置)
$.notify("I'm over here !");
3.通知样式
每个样式可以定义用于对通知进行替换的一组类。 预打包版本包括引导通知样式(详见下面的样式)。 这些类包括:
Success
$.notify("Access granted", "success");
Info$.notify("Do not press this button", "info");
Warning$.notify("Warning: Self-destruct in 3.. 2..", "warn");
Error$.notify("BOOM!", "error");
注意:此页面使用 $.notify.defaults({ className: "success" }); 将缺省类设置为“成功”。