-
Notifications
You must be signed in to change notification settings - Fork 0
/
frame.html
111 lines (98 loc) · 2.51 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
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
<!DOCTYPE html>
<html>
<body>
<style>
.scroller {
scroll-behavior: smooth;
overflow-y: scroll;
height: 90vh;
border: solid 1px black;
display: inline-block;
position: relative;
}
.sidebar {
width: 20vw;
}
.content {
width: 70vw;
}
.box {
width: 100%;
background-color: teal;
border-top: solid 1px black;
text-align: center;
place-content: center;
font-size: 3rem;
}
.sidebar .box {
margin-bottom: 5%;
height: 10%;
}
.sidebar::before {
content: "Sidebar";
position: fixed;
border: solid 1px black;
background-color: grey;
}
.content::before {
content: "Content";
position: fixed;
border: solid 1px black;
background-color: grey;
}
.content .box {
margin-bottom: 5%;
height: 40%;
}
.space {
height: 200vh;
width: 200vw;
}
:target, .ctarget {
background-color: yellow;
}
</style>
<div>
<div class="sidebar scroller">
<div class="box" id="sb1">1</div>
<div class="box" id="sb2">2</div>
<div class="box" id="sb3">3</div>
<div class="box" id="sb4">4</div>
<div class="box" id="sb5">5</div>
<div class="box" id="sb6">6</div>
<div class="box" id="sb7">7</div>
<div class="box" id="sb8">8</div>
<div class="box" id="sb9">9</div>
<div class="box" id="sb10">10</div>
<div class="box" id="sb11">11</div>
<div class="box" id="sb12">12</div>
<div class="box" id="sb13">13</div>
<div class="box" id="sb14">14</div>
</div>
<div class="content scroller">
<div class="box" id="c1">1</div>
<div class="box" id="c2">2</div>
<div class="box" id="c3">3</div>
<div class="box" id="c4">4</div>
<div class="box" id="c5">5</div>
<div class="box" id="c6">6</div>
<div class="box" id="c7">7</div>
<div class="box" id="c8">8</div>
<div class="box" id="c9">9</div>
<div class="box" id="c10">10</div>
<div class="box" id="c11">11</div>
<div class="box" id="c12">12</div>
<div class="box" id="c13">13</div>
<div class="box" id="c14">14</div>
</div>
</div>
<script>
window.addEventListener("load", () => {
const num = location.hash.substring(3);
const content_target = document.getElementById(`c${num}`);
content_target.scrollIntoView();
content_target.classList.add("ctarget");
});
</script>
</body>
</html>