-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
66 lines (55 loc) · 2.11 KB
/
index.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
integrity="sha384-B0vP5xmATw1+K9KRQjQERJvTumQW0nPEzvF6L/Z6nronJ3oUOFUFpCjEUQouq2+l" crossorigin="anonymous">
</head>
<body>
<div class="container mt-5">
<div class="row">
<div class="col">
<button class="btn btn-success" onclick="alert('<h1>hahaha</h1>')">Alert bằng modal</button>
<button class="btn btn-danger" onclick="confirm('Custom confirm', alert.bind(window, 'Alert sau khi hiện confirm'))">Custom
confirm modal based</button>
<button id="btn-modal-sm" class="btn btn-info">Tạo & show modal nhỏ</button>
<button id="btn-modal-lg" class="btn btn-danger">Tạo & show modal to</button>
<button id="btn-modal" class="btn btn-outline-primary">Lỗi! Không tạo được modal</button>
</div>
</div>
</div>
</body>
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"></script>
<script src="modal.js"></script>
<script>
$("#btn-modal-sm").click(function (ev) {
var modal = new Modal("modal-sm", "Modal nhỏ");
modal.useSmallSize();
modal.setDefaultFooterButton("Button bên trái", null);
modal.useButtonOnTheLeft(); // Button at right
modal.show();
});
$("#btn-modal-lg").click(function (ev) {
var modal = new Modal("modal-lg", "Modal to vcl");
modal.useFullScreenSize();
modal.setDefaultFooterButton('Ok', 'Hủy');
// modal.useButtonOnTheLeft();
var content = "123 ab cdfg kkgnb ";
var res="";
for (let index = 0; index < 1000; index++) {
res += content;
}
modal.appendBody(res);
modal.show();
});
$("#btn-modal").click(function (ev) {
var modal = new Modal(); // Lỗi do không truyền tên modal
modal.show();
});
</script>
</html>