forked from rodneyrehm/viewport-units-buggyfill
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·46 lines (45 loc) · 1.39 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Viewport Units Buggyfill™</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="test.css">
<link rel="stylesheet" href="test-ignore.css" data-viewport-units-buggyfill="ignore">
<style>
head {display: block}
#patched-viewport {
display: block;
padding: 10px;
white-space: pre;
font-family: monospace;
}
</style>
<style media="(max-width: 320px)">
body { width: 90vw; }
</style>
<style media="(min-width: 480px)">
body { width: 70vw; }
</style>
</head>
<body>
<p><strong>Note:</strong> this script will only work with browsers that have buggy implementations of viewport units and will not polyfill viewport units in older browsers (e.g. IE <= 8)</p>
<script src="viewport-units-buggyfill.js"></script>
<script src="viewport-units-buggyfill.hacks.js"></script>
<script>window.viewportUnitsBuggyfill.init({
// ignore browser capability, run this puppy everywhere
force: true,
// milliseconds to delay between updates of viewport-units
// caused by orientationchange, pageshow, resize events
refreshDebounceWait: 250,
hacks: window.viewportUnitsBuggyfillHacks,
// append to body
appendToBody: true
});</script>
<style>
.css-in-body {
width: 25vw;
}
</style>
</body>
</html>