-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.html
More file actions
36 lines (32 loc) · 822 Bytes
/
Copy pathtest.html
File metadata and controls
36 lines (32 loc) · 822 Bytes
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
<html>
<body>
<style>
.window {
width: 200px;
height: 200px;
border: 1px solid black;
overflow: hidden;
position: relative;
}
.grid {
width: 1000px;
height: 1000px;
background-image: url("https://images.pexels.com/photos/33044/sunflower-sun-summer-yellow.jpg?auto=compress&cs=tinysrgb&h=350");
position: absolute;
top: 0;
transition: top 1s linear;
}
</style>
<div class="window">
<div class="grid">
</div>
</div>
<script>
var viewport = document.getElementsByClassName("window")[0]
var grid = document.getElementsByClassName("grid")[0]
viewport.addEventListener("click", () => {
grid.style.top = "-20px"
})
</script>
</body>
</html>