-
Notifications
You must be signed in to change notification settings - Fork 0
/
customvp.html
73 lines (63 loc) · 3.29 KB
/
customvp.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
67
68
69
70
71
72
73
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta name="viewport" id="viewport" />
<style>
html {
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAIAAAD/gAIDAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFpSURBVHhe7durEcJAAEVRgsXRCPVCRziQUAI/BdhgKCDXZSYn+oqds2/idhjHcTWz7/z67LabmR1qdbje13M705zPAyvcDixYQSCklgUrCITUsmAFgZBaFqwgEFLLghUEQmpZsIJASC0LVhAIqWXBCgIhtSxYQSCklgUrCITUsmAFgZBaFqwgEFLLghUEQmpZsIJASC0LVhAIqWXBCgIhtSxYQSCklgUrCITUsmAFgZBaFqwgEFLLghUEQmpZsIJASC0LVhAI6XB6vkO+4PT4+A5esk4cgJesE6H+mR988IIFKwiE1LJgBYGQWhasIBBSy4IVBEJqWbCCQEgtC1YQCKllwQoCIbUsWEEgpJYFKwiE1LJgBYGQWhasIBBSy4IVBEJqWbCCQEgtC1YQCKllwQoCIbUsWEEgpJYFKwiE1LJgBYGQWhasIBBSy4IVBEJqWbCCQEgtC1YQCKllwQoCIR32l1vIl53+AI/JGTUBmZViAAAAAElFTkSuQmCC) repeat local;
}
</style>
<script>
window.addEventListener("load", doDuringLoad);
window.addEventListener("load", function() {setTimeout(doAfterLoad, 1000)});
var iWbl, sWbl, cWbl;
iWbl = window.innerWidth;
sWbl = screen.width;
cWbl = document.documentElement.clientWidth;
function doDuringLoad() {
document.getElementById("iWbl").innerHTML = iWbl;
document.getElementById("sWbl").innerHTML = sWbl;
document.getElementById("cWbl").innerHTML = cWbl;
document.getElementById("iWdl").innerHTML = innerWidth;
document.getElementById("sWdl").innerHTML = screen.width;
document.getElementById("cWdl").innerHTML = document.documentElement.clientWidth;
}
function doAfterLoad() {
document.getElementById("iWal").innerHTML = innerWidth;
document.getElementById("sWal").innerHTML = screen.width;
document.getElementById("cWal").innerHTML = document.documentElement.clientWidth;
document.getElementById("vp").innerHTML = document.getElementById("viewport").content;
document.getElementById("setVPbutton").addEventListener("click", doOnClick);
}
function doOnClick() {
viewport.content = document.getElementById("vpinput").value;
document.getElementById("iWclick").innerHTML = innerWidth;
document.getElementById("sWclick").innerHTML = screen.width;
document.getElementById("cWclick").innerHTML = document.documentElement.clientWidth;
document.getElementById("vp").innerHTML = document.getElementById("viewport").content;
}
</script>
</head>
<body>
<input id="vpinput" type="text" /><button id="setVPbutton">Click to set vp</button>
<h1>Before load:</h1>
<p>innerWidth before load is: <span id="iWbl"></span></p>
<p>screen.width before load is: <span id="sWbl"></span></p>
<p>document.documentElement.clientWidth before load is: <span id="cWbl"></span></p>
<h1>During load:</h1>
<p>innerWidth during load is: <span id="iWdl"></span></p>
<p>screen.width during load is: <span id="sWdl"></span></p>
<p>document.documentElement.clientWidth during load is: <span id="cWdl"></span></p>
<h1>After load:</h1>
<p>innerWidth after load is: <span id="iWal"></span></p>
<p>screen.width after load is: <span id="sWal"></span></p>
<p>document.documentElement.clientWidth after load is: <span id="cWal"></span></p>
<h1>After click:</h1>
<p>innerWidth after click is: <span id="iWclick"></span></p>
<p>screen.width after click is: <span id="sWclick"></span></p>
<p>document.documentElement.clientWidth after click is: <span id="cWclick"></span></p>
<p></p>
<p>viewport content is <span id="vp"></span></p>
</body>
</html>