-
Notifications
You must be signed in to change notification settings - Fork 0
/
frame.html
47 lines (47 loc) · 1.1 KB
/
frame.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 lang="en">
<head>
<meta charset="UTF-8">
<title>Frames</title>
<style>
body { margin: 10px; }
.frames {
display: -webkit-flex;
display: -moz-flex;
display: -ms-flex;
display: -o-flex;
display: flex;
}
iframe {
float: left;
height: calc(100vh - 20px);
margin-right: 10px;
resize: horizontal;
overflow: auto;
border: 1px solid #000;
flex: 0 0 auto;
}
iframe:last-child { margin-right: 0; }
</style>
</head>
<body>
<div class="frames">
<iframe src="" frameborder="0" width="320" height="1200"></iframe>
<iframe src="" frameborder="0" width="768" height="1200"></iframe>
<iframe src="" frameborder="0" width="1024" height="1200"></iframe>
</div>
<script>
let l = location,
ori = l.origin,
page = l.search.replace('?', ''),
iframes = document.querySelectorAll('iframe'),
url;
if (page) {
url = ori + '/public/' + page + '.html';
for(let l = iframes.length; l--;) {
iframes[l].src = url;
}
}
</script>
</body>
</html>