-
Notifications
You must be signed in to change notification settings - Fork 0
/
单个窗口.html
75 lines (72 loc) · 1.32 KB
/
单个窗口.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
<!DOCTYPE html>
<html>
<head>
<title>单个窗口</title>
<style type="text/css">
*{margin:0;padding:0;}
.scrollBox{
position: relative;
overflow: hidden;
max-height:120px;
}
.svSlider{
width:4px;height:100%;
position: absolute;
right:2px;top:0;
z-index:10;
}
/* 滑块 */
.svSlider .svbar{
position: absolute;
width:4px;background:#dadada;
cursor:pointer;
}
.scrollBoxMain {
position: relative;
left:0;right:0;
}
.demo {
width:300px;
margin:20px auto;
}
.demo ul li{
width:100%;height:30px;
background:#f5f7fc;
line-height:30px;
}
</style>
</head>
<body>
<!-- 滚动窗口 s -->
<div class="demo scrollBox">
<!-- 滚动条样式 s -->
<div class="svSlider">
<div class="svbar"></div>
</div>
<!-- 滚动条样式 e -->
<!-- 滚动内容 s -->
<div class="scrollBoxMain">
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
<li>7</li>
<li>8</li>
<li>9</li>
</ul>
</div>
<!-- 滚动内容 e -->
</div>
<!-- 滚动窗口 e -->
<script type="text/javascript" src="js/scroll.js"></script>
<script type="text/javascript">
window.onload = function() {
var scrollBox = document.querySelector('.scrollBox');
var bar = new Bar(scrollBox, 30);
}
</script>
</body>
</html>