-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsxs.html
155 lines (149 loc) · 4.06 KB
/
sxs.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<!DOCTYPE html>
<html>
<head>
<title>SxS Browsing for Chrome</title>
<style type="text/css">
html, body {
margin: 0;
padding: 0;
border: 0;
height: 100%;
}
.htile, .vtile {
display: box;
display: -webkit-box;
display: -moz-box;
box-align: stretch;
-webkit-box-align: stretch;
-moz-box-align: stretch;
box-lines: single;
}
.htile {
box-orient: horizontal;
-webkit-box-orient: horizontal;
-moz-box-orient: horizontal;
}
.vtile {
box-orient: vertical;
-webkit-box-orient: vertical;
-moz-box-orient: vertical;
}
.htile > *, .vtile > * {
box-flex: 1.0;
-webkit-box-flex: 1.0;
-moz-box-flex: 1.0;
}
.tabs {
width: 100%;
height: 100%;
}
.tabs section {
display: box;
display: -webkit-box;
display: -moz-box;
box-orient: vertical;
-webkit-box-orient: vertical;
-moz-box-orient: vertical;
box-align: stretch;
-webkit-box-align: stretch;
-moz-box-align: stretch;
box-lines: single;
}
.tabs section nav {
box-flex: 0;
-webkit-box-flex: 0;
-moz-box-flex: 0;
display: box;
display: -webkit-box;
display: -moz-box;
box-orient: horizontal;
-webkit-box-orient: horizontal;
-moz-box-orient: horizontal;
box-lines: single;
}
.tabs section .iframe_container {
box-flex: 1.0;
-webkit-box-flex: 1.0;
-moz-box-flex: 1.0;
}
.tabs section iframe {
border: 0;
margin: 0;
padding: 0;
position: absolute;
}
.tabs section nav button {
display: block;
box-flex: 0;
-webkit-box-flex: 0;
-moz-box-flex: 0;
}
.tabs section nav input {
display: block;
box-flex: 1.0;
-webkit-box-flex: 1.0;
-moz-box-flex: 1.0;
}
</style>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
</head>
<body>
<div class="tabs htile">
<div class="vtile">
<section>
<nav>
<input type="text" value="http://www.pandora.com" />
<button>Go</button>
</nav>
<div class="iframe_container">
<iframe></iframe>
</div>
</section>
<section>
<nav>
<input type="text" value="http://docs.google.com" />
<button>Go</button>
</nav>
<div class="iframe_container">
<iframe></iframe>
</div>
</section>
</div>
<section>
<nav>
<input type="text" value="http://webchat.freenode.net" />
<button>Go</button>
</nav>
<div class="iframe_container">
<iframe></iframe>
</div>
</section>
</div>
<script type="text/javascript">
$(window).load(function() {
$(".tabs section").each(function(index, section) {
var _addressBar = $($("nav input", section).first());
var iframeDiv = $(".iframe_container", section).first()[0];
console.log(iframeDiv);
var style = window.getComputedStyle(iframeDiv);
console.log(style);
var divWidth = style.getPropertyValue('width');
var divHeight = style.getPropertyValue('height');
var _iframe = $($("iframe", section).first());
console.log([divWidth, divHeight]);
_iframe.css({
width: divWidth,
height: divHeight,
});
(function(addressBar, iframe) {
$("nav button", section).click(function() {
var address = addressBar.attr('value');
console.log([address]);
iframe.attr('src', address);
});
})(_addressBar, _iframe);
});
});
</script>
</body>
</html>