-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.html
38 lines (35 loc) · 1.23 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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="../node_modules/bootstrap/dist/css/bootstrap.min.css">
<title>bsBreakpoints</title>
</head>
<body>
<div class="container">
<h1>bsBreakpoints</h1>
<div>
<p>
Current breakpoint : <span id="cBreakPoint" class="badge rounded-pill text-bg-primary"></span>
</p>
</div>
</div>
<script src="../dist/bs-breakpoints.umd.cjs"></script>
<script>
document.addEventListener('DOMContentLoaded', function () {
const cBreakPoint = document.getElementById('cBreakPoint');
console.log(cBreakPoint);
window.addEventListener('init.bs.breakpoint', function (e) {
cBreakPoint.textContent = e.detail.breakpoint;
console.warn(e.detail, e.detail.breakpoint);
});
window.addEventListener('new.bs.breakpoint', function (e) {
cBreakPoint.textContent = e.detail.breakpoint;
console.warn(e.detail, e.detail.breakpoint);
});
const detector = new bsBreakpoints.BreakpointDetector();
})
</script>
</body>
</html>