forked from mdbootstrap/TW-Elements
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nested-native-scroll.html
68 lines (67 loc) · 1.83 KB
/
nested-native-scroll.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
<!DOCTYPE html>
<html>
<head>
<link href="../css/perfect-scrollbar.css" rel="stylesheet">
<script src="../dist/perfect-scrollbar.js"></script>
<style>
#container {
position: relative;
margin: 0px auto;
padding: 0px;
width: 600px;
height: 400px;
overflow: auto;
}
#container .content {
background-image: url('./assets/azusa.jpg');
width: 1280px;
height: 720px;
}
.my-list, textarea {
position: absolute;
top: 0;
left: 0;
width: 130px;
height: 200px;
overflow: scroll;
background-color: white;
}
ul {
margin: 0;
padding: 0;
}
li {
box-sizing: border-box;
padding: 10px 5px;
border-width: 0 0 1px 0;
list-style-type: none;
margin: 0;
}
li:nth-child(even) {
background-color: rgba(0,0,0,0.5);
}
</style>
</head>
<body>
<div id="container">
<div class="content">
<textarea cols="20" rows="50" style="font-size: 120%">
Children inside perfect scrollbar can be natively scrolled by the
mousewheel. It automatically works for textarea elements, other
elements need the .ps-child class.
</textarea>
<div class="my-list" style="left: 140px">
<code>overflow: scroll</code>
<ul><li>One</li><li>Two</li><li>Three</li><li>Four</li><li>Five</li><li>Six</li><li>Seven</li><li>Eight</li></ul>
</div>
<div class="my-list" style="left: 280px; overflow: auto">
<code>overflow: auto</code>
<ul><li>One</li><li>Two</li><li>Three</li><li>Four</li><li>Five</li><li>Six</li><li>Seven</li><li>Eight</li></ul>
</div>
</div>
</div>
<script type="text/javascript">
new PerfectScrollbar('#container');
</script>
</body>
</html>