forked from blakelee-pendo/blakelee-pendo.github.io
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathiframe-town-inner-1.html
82 lines (79 loc) · 2.78 KB
/
iframe-town-inner-1.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
<html>
<head>
<style>
body {
background-color: rgba(250, 50, 0, 0.3);
height: 100%;
width: 100%;
padding: 10px;
margin: 0px;
box-sizing: border-box;
}
iframe {
height: 200px;
}
.text {
padding: 10px;
font-size: 16px;
}
.container {
display: flex;
}
.some-dropdown {
margin-top: 15px;
}
#hidden-toggle-content {
display: none;
margin-top: 10px;
}
#hidden-toggle-content.visible {
display: block;
}
</style>
<script>
function addIframe() {
const iframe = document.createElement('iframe');
iframe.src = '/iframe-town-inner-2.html';
document.querySelector('.frame-container').appendChild(iframe);
}
function toggleHiddenContentVisibility() {
const ele = document.getElementById('hidden-toggle-content');
ele.classList.toggle('visible');
}
</script>
</head>
<body>
<div class="container">
<div class="text">Inner iframe</div>
<button onclick="addIframe()" class="add-iframe-btn">Add another iframe in...this iframe</button>
</div>
<div class="frame-container">
<iframe src="/iframe-town-inner-2.html"></iframe>
</div>
<script>
var someId = String(parseInt(Math.random() * 10000000));
var anotherId = String(parseInt(Math.random() * 10000000));
document.querySelector('.text').id = `random-${someId}`;
document.querySelector('button').id = `random-${anotherId}`;
</script>
<select class="some-dropdown">
<option value="" disabled selected>Select your option</option>
<option>opt 1</option>
<option>opt 2</option>
<option>opt 3</option>
</select>
<button onclick="toggleHiddenContentVisibility()">
A button that doesn't do anything...unless...
</button>
<div id="hidden-toggle-content">
WOAH, IT <strong>DOES</strong> DO SOMETHING
</div>
<h3>Check out this scroll container tho</h3>
<h4>What could be down there?</h4>
<div id="scroll-container" style="height: 200px; overflow: scroll; border: 1px solid black; width: 300px;">
<div class="dumb-hidden-text" style="margin-top: 1000px;padding: 10px;">
...oh, just this? laaaaaaaame
</div>
</div>
</body>
</html>