-
Notifications
You must be signed in to change notification settings - Fork 40
/
demo.html
175 lines (161 loc) · 7.99 KB
/
demo.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>jquery scroll - have a custom styled scrollbar</title>
<style type="text/css" media="screen">
/* demo styles */
html, body{background:#EEE;color:#111;font:13px Helvetica,sans-serif;}
body{margin:20px auto;width:1200px;}
#demo1,#demo2,#demo3,#demo4{float:left;}
.action{margin: 50px 0 10px 0;}
a{color:#F44;text-decoration:none;}
a:hover{text-decoration:underline;}
.scrollbar{width:250px;height:300px;margin:0 60px 0 0;-moz-box-shadow:0px 0px 12px 3px #CCC;overflow:hidden;float:left;background:#FFF;border:6px solid #B2B2B2;}
.scrollbar.simple{width:250px;height:400px;margin:0 60px 0 0;overflow:hidden;float:left;background:#EEE;-moz-box-shadow:none;border:none;}
.scrollbar.noborder{border:none;}
.scrollbar p{margin:0;padding:8px;line-height:1.4;}
</style>
<style type="text/css">
ul.months {
display: block;
overflow: auto;
width: 51px;
background: #FFF;
border: 1px solid #B2B2B2;
list-style: none;
margin: 0 60px 0 0;
max-height: 220px;
overflow-x: hidden;
overflow-y: auto;
padding: 4px 0;
}
ul.months li {
color: #111;
cursor: pointer;
font-size: 93%;
padding: 1px 5px;
text-align: left;
white-space: nowrap;
}
.plain {
max-height: 100px;
}
</style>
<link href="css/scrollbar.css" type="text/css" rel="stylesheet" />
</head>
<body>
<div id="demo1">
<div class="action"><a href="#">jump to 25</a></div>
<ul id="container1" class="scrollbar fff months">
<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>
<li>10</li>
<li>11</li>
<li>12</li>
<li>13</li>
<li>14</li>
<li>15</li>
<li>16</li>
<li>17</li>
<li>18</li>
<li>19</li>
<li>20</li>
<li>21</li>
<li>22</li>
<li>23</li>
<li>24</li>
<li>25</li>
<li>26</li>
<li>27</li>
<li>28</li>
<li>29</li>
<li>30</li>
<li>31</li>
<li>32</li>
<li>33</li>
<li>34</li>
<li>35</li>
<li>36</li>
<li>37</li>
<li>38</li>
<li>39</li>
<li>40</li>
<li>41</li>
<li>42</li>
<li>43</li>
<li>44</li>
<li>45</li>
<li>46</li>
<li>47</li>
<li>48</li>
<li>49</li>
<li>50</li>
<li>51</li>
<li>52</li>
<li>53</li>
<li>54</li>
<li>55</li>
<li>56</li>
<li>57</li>
<li>58</li>
<li>59</li>
<li>60</li>
<li>61</li>
<li>62</li>
<li>63</li>
<li>64</li>
</ul>
</div>
<div id="demo2">
<div class="action"><a href="#">add paragraph</a> | <a href="#">remove paragraph</a></div>
<div id="container2" class="scrollbar simple">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Excepteur sint ocjshdkalksj jdsfsd. Culpa qui officia deserunt mollit anim id est laborum. Excepteur sint ocjshdkalksj jdsfsd.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Excepteur sint ocjshdkalksj jdsfsd. Culpa qui officia deserunt mollit anim id est laborum. Excepteur sint ocjshdkalksj jdsfsd.</p>
</div>
</div>
<div id="demo3">
<div class="action"> </div>
<div class="scrollbar">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Excepteur.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Excepteur.</p>
</div>
</div>
<div id="demo4">
<div class="action"> </div>
<div class="scrollbar noborder">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Excepteur.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Excepteur.</p>
</div>
</div>
<!--[if IE]>
<script type="text/javascript" src="https://getfirebug.com/firebug-lite.js"></script>
<![endif]-->
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<script type="text/javascript" src="jquery.scroll.min.js"></script>
<script type="text/javascript">
$('.scrollbar').scrollbar();
$('#demo1 a').click(function(ev){
ev.preventDefault();
$('#container1').scrollbar('scrollto', $('.scrollbar:first li:eq(24)'));
});
$('#demo2 a:first').click(function(ev){
ev.preventDefault();
$('#demo2').find('.scrollbar-pane').children(':first').clone().appendTo('.scrollbar-pane');
$('#container2').scrollbar('repaint');
});
$('#demo2 a:last').click(function(ev){
ev.preventDefault();
$('#demo2').find('.scrollbar-pane').children(':first').remove();
$('#container2').scrollbar('repaint');
});
</script>
</body>
</html>