源代碼
點擊運行
<!doctype html> <html> <head> <meta charset="utf-8"> <title>jQuery Growl 插件</title> <script src="https://cdn.staticfile.org/jquery/2.0.2/jquery.min.js" type="text/javascript"></script> <script src="http://static./assets/jquery/jquery.growl/javascripts/jquery.growl.js" type="text/javascript"></script> <link href="http://static./assets/jquery/jquery.growl/stylesheets/jquery.growl.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> $(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: "提醒消息內容!" }); }); return $('.warning').click(function(event) { event.preventDefault(); event.stopPropagation(); return $.growl.warning({ title: "警告標題", message: "警告消息內容!" }); }); }); </script> </head> <body> <ul> <li> <a class="error" href="#">錯誤!</a> </li> <li> <a class="notice" href="#">提醒!</a> </li> <li> <a class="warning" href="#">警告!</a> </li> </ul> </body> </html>
運行結果