弹出框/提示框插件
一、sweetalert
cdn
<link href="https://cdn.bootcss.com/sweetalert/1.1.3/sweetalert.min.css" rel="stylesheet">
<script src="https://cdn.bootcss.com/sweetalert/1.1.3/sweetalert.min.js"></script>
代码
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/twitter-bootstrap/4.3.0/css/bootstrap.min.css">
<link href="https://cdn.bootcss.com/sweetalert/1.1.3/sweetalert.min.css" rel="stylesheet">
<script src="https://cdn.bootcss.com/jquery/3.4.0/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" src="https://cdn.bootcss.com/twitter-bootstrap/4.3.0/js/bootstrap.min.js"></script>
<script src="https://cdn.bootcss.com/sweetalert/1.1.3/sweetalert.min.js"></script>
</head>
<body>
<button id="submit">click</button>
<script type="text/javascript">
$(function() {
$("#submit").click(function(event) {
swal("干得漂亮!", "你点击了按钮!","success")
});
})
</script>
</body>
</html>
二、toastr
代码
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/toastr.js/latest/css/toastr.min.css">
<script src="https://cdn.bootcss.com/jquery/3.4.0/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" src="https://cdn.bootcss.com/toastr.js/latest/js/toastr.min.js"></script>
<script type="text/javascript">
toastr.options.positionClass = "toast-top-center";
</script>
</head>
<body>
<button id="button1">异常</button>
<script type="text/javascript">
$(function() {
$('#button1').click(function () {
toastr.info("121.");
toastr.success("hello world.");
toastr.warning("hello world.");
toastr.error("hello world.");
});
})
</script>
</body>
</html>