-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathlongresize.html
47 lines (38 loc) · 1.17 KB
/
longresize.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
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width">
<style>
html, body {
margin: 0px;
width: 100%;
height: 100%;
}
#resizeinfo {
width: 100px;
height: 200px;
}
</style>
<script>
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function blockFor(delayTimeMs) {
await sleep(delayTimeMs);
}
function didResize() {
console.log("Resize Handler...");
blockFor(3000);
console.log("Done sleep");
var resizebox = document.getElementById("resizeinfo");
resizebox.innerHTML += "RESIZE!<br>"
}
window.addEventListener('load', function() {
window.addEventListener('resize', didResize);
});
</script>
</head>
<body>
<div id="resizeinfo"></div>
</body>
</html>