-
Notifications
You must be signed in to change notification settings - Fork 0
/
alert.html
46 lines (36 loc) · 1.21 KB
/
alert.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" href="css/bootstrap.css">
<script src="js/jquery.3.2.1.min.js"></script>
<script src="js/bootstrap.js"></script>
</head>
<body>
<div class="alert alert-warning alert-dismissible fade show" role="alert" id="al">
<strong>Holy guacamole!</strong> You should check in on some of those fields below.
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<button class="btn btn-info" id="btn">隐藏</button>
<button class="btn btn-info" id="btn2">显示</button>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<script>
$(function () {
$('#btn').click(function () {
$('#al').alert('close')
})
$('#btn2').click(function () {
$('#al').alert()
})
$('#al').on('closed.bs.alert', function () {
alert('关闭了')
})
})
</script>
</body>
</html>