Skip to content

Commit 8ae21e4

Browse files
adding an overscroll-behavior-x example
1 parent 2b83816 commit 8ae21e4

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width">
6+
<title>overscroll-behavior-x demo</title>
7+
<style>
8+
main {
9+
height: 500px;
10+
width: 3000px;
11+
background-color: magenta;
12+
background-image: repeating-linear-gradient(to right, rgba(0,0,0,0) 0px, rgba(0,0,0,0) 19px, rgba(0,0,0,0.5) 20px);
13+
}
14+
15+
main > div {
16+
height: 300px;
17+
width: 500px;
18+
overflow: auto;
19+
position: relative;
20+
top: 100px;
21+
left: 100px;
22+
overscroll-behavior-x: contain;
23+
}
24+
25+
div > div {
26+
height: 100%;
27+
width: 1500px;
28+
background-color: yellow;
29+
background-image: repeating-linear-gradient(to right, rgba(0,0,0,0) 0px, rgba(0,0,0,0) 19px, rgba(0,0,0,0.5) 20px);
30+
}
31+
32+
p {
33+
padding: 10px;
34+
background-color: rgba(255,0,0,0.5);
35+
margin: 0;
36+
width: 300px;
37+
position: relative;
38+
top: 10px;
39+
left: 10px;
40+
}
41+
</style>
42+
</head>
43+
<body>
44+
<h1>overscroll-behavior-x demo</h1>
45+
<main>
46+
<div>
47+
<div>
48+
<p><code>overscroll-behavior-x</code> has been used to make it so that when the scroll boundaries of the inner box are reached, the whole page does not begin to scroll.</p>
49+
</div>
50+
</div>
51+
</main>
52+
</body>
53+
</html>

0 commit comments

Comments
 (0)