jQuery Growl 侧边消息提醒

最后更新于:2022-04-02 03:14:34

[TOC] > [参考](https://www.runoob.com/jquery/jquery-plugin-message.html) > [官网](http://ksylvest.github.io/jquery-growl/) ## 概述 在侧边显示效果 ![](https://www.runoob.com/wp-content/uploads/2016/09/B516C4CF-CD32-4E18-B4CF-AF4DBE137CED.jpg) ## 引入 ``` ``` ## 格式 ``` $.growl({ title: "消息标题", message: "消息内容!" }); $.growl.error({ title: "错误标题", message: "错误消息内容!" }); $.growl.notice({title: "提醒标题", message: "提醒消息内容!" }); $.growl.warning({title: "警告标题", message: "警告消息内容!" }); ``` ## 示例 ``` $(function() { $.growl({ title: "消息标题", message: "消息内容!" }); $('.error').click(function(event) { event.preventDefault(); event.stopPropagation(); return $.growl.error({ title: "错误标题", message: "错误消息内容!" }); }); $('.notice').click(function(event) { event.preventDefault(); event.stopPropagation(); return $.growl.notice({ title: "提醒标题", message: "提醒消息内容!" }); }); $('.warning').click(function(event) { event.preventDefault(); event.stopPropagation(); return $.growl.warning({ title: "警告标题", message: "警告消息内容!" }); }); }); ```
';