1、html 內容
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" type="text/css" href="../plugins/toastr/toastr.min.css"/>
<script src="../plugins/jquery/jquery-3.4.1.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../plugins/toastr/toastr.min.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
</body>
<script type="text/javascript">
toastr.options = {
closeButton: true, //是否顯示關閉按鈕
progressBar: true, //顯示關閉的進度
//toast-bottom-right、toast-bottom-left、toast-top-left、toast-top-full-width、toast-bottom-full-width
//toast-top-center、toast-bottom-center
positionClass: "toast-top-center",
//顯示時間長度
timeOut: "1000",
showEasing: "linear", //顯示時的動畫緩衝方式
hideEasing: "linear", //消失時的動畫緩衝方式
showMethod: "fadeIn", //顯示時的動畫方式
hideMethod: "fadeOut" //消失時的動畫方式
}
toastr.success("連接已建立,可以進行通信!")
toastr.success("連接已建立,可以進行通信!", "成功")
toastr.info("請先登錄!")
toastr.warning("連接建立失敗,請重試!")
toastr.error("連接不能打開!");
// toastr.clear();
</script>
</html>