-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.html
63 lines (54 loc) · 1.74 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>basic-seamless-iframe</title>
<script src="../webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="basic-seamless-iframe.html">
<style>
body,
button,
input {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 15px;
}
body {
margin: 0.5in;
}
#frame {
border: 1px dotted gray;
}
</style>
<script>
window.addEventListener('WebComponentsReady', function() {
var frame = document.querySelector('#frame');
var contentCopy = document.querySelector('#contentCopy');
/* Listen for content changes within the framed page. */
frame.addEventListener('framedContentChanged', function(event) {
contentCopy.innerHTML = event.detail.trim();
});
});
</script>
</head>
<!--
NOTE: This demo doesn't follow the norm for basic-seamless-iframe and
basic-framed-content demos! Normally the entire contents of the body would go
inside a basic-framed-content element, but that'll get a bit meta, and easily
confusing. We're want to emphasize that basic-framed-content goes on the
*framed* page, not a framing like this one.
-->
<body unresolved>
<p>
The rectangle below is a separate, framed page:
</p>
<basic-seamless-iframe id="frame" src="framed.html"></basic-seamless-iframe>
<p>
An instance of <basic-seamless-iframe> here in the outer page is
communicating across the frame boundary with an instance of
<basic-framed-content> in the framed page.
This lets the outer page see that the content of the framed page is:
"<span id="contentCopy"></span>" This also lets the frame rectangle
automatically size itself to the content of the framed page.
</p>
</body>
</html>