-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhorizontal.html
193 lines (171 loc) · 3.29 KB
/
horizontal.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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
<title>FastScroll demo: horizontal scrolling</title>
<script type="text/javascript" src="./build/fastscroll.m.js"></script>
<script type="text/javascript">
var myScroll;
function loaded () {
myScroll = new FastScroll('#wrapper', { scrollX: true, scrollY: false});
}
</script>
<style type="text/css">
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
html {
-ms-touch-action: none;
}
body,ul,li {
padding: 0;
margin: 0;
border: 0;
}
body {
font-size: 12px;
font-family: ubuntu, helvetica, arial;
overflow: hidden; /* this is important to prevent the whole page to bounce */
}
#header {
position: absolute;
z-index: 2;
top: 0;
left: 0;
width: 100%;
height: 45px;
line-height: 45px;
background: #CD235C;
padding: 0;
color: #eee;
font-size: 20px;
text-align: center;
font-weight: bold;
}
#footer {
position: absolute;
z-index: 2;
bottom: 0;
left: 0;
width: 100%;
height: 48px;
background: #444;
padding: 0;
border-top: 1px solid #444;
}
#wrapper {
position: absolute;
z-index: 1;
top: 45px;
bottom: 48px;
left: 0;
width: 100%;
background: #ccc;
overflow: hidden;
}
#scroller {
position: absolute;
z-index: 1;
-webkit-tap-highlight-color: rgba(0,0,0,0);
width: 5000px;
height: 100%;
background-color: #a00;
-webkit-transform: translateZ(0);
-moz-transform: translateZ(0);
-ms-transform: translateZ(0);
-o-transform: translateZ(0);
transform: translateZ(0);
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-text-size-adjust: none;
-moz-text-size-adjust: none;
-ms-text-size-adjust: none;
-o-text-size-adjust: none;
text-size-adjust: none;
}
#scroller ul {
list-style: none;
padding: 0;
margin: 0;
width: 100%;
height: 100%;
text-align: center;
}
#scroller li {
display: block;
float: left;
width: 100px;
height: 100%;
border-right: 1px solid #ccc;
background-color: #fafafa;
font-size: 14px;
}
</style>
</head>
<body onload="loaded()">
<div id="header">horizontal scrolling</div>
<div id="wrapper">
<div id="scroller">
<ul>
<li>Cell 1</li>
<li>Cell 2</li>
<li>Cell 3</li>
<li>Cell 4</li>
<li>Cell 5</li>
<li>Cell 6</li>
<li>Cell 7</li>
<li>Cell 8</li>
<li>Cell 9</li>
<li>Cell 10</li>
<li>Cell 11</li>
<li>Cell 12</li>
<li>Cell 13</li>
<li>Cell 14</li>
<li>Cell 15</li>
<li>Cell 16</li>
<li>Cell 17</li>
<li>Cell 18</li>
<li>Cell 19</li>
<li>Cell 20</li>
<li>Cell 21</li>
<li>Cell 22</li>
<li>Cell 23</li>
<li>Cell 24</li>
<li>Cell 25</li>
<li>Cell 26</li>
<li>Cell 27</li>
<li>Cell 28</li>
<li>Cell 29</li>
<li>Cell 30</li>
<li>Cell 31</li>
<li>Cell 32</li>
<li>Cell 33</li>
<li>Cell 34</li>
<li>Cell 35</li>
<li>Cell 36</li>
<li>Cell 37</li>
<li>Cell 38</li>
<li>Cell 39</li>
<li>Cell 40</li>
<li>Cell 41</li>
<li>Cell 42</li>
<li>Cell 43</li>
<li>Cell 44</li>
<li>Cell 45</li>
<li>Cell 46</li>
<li>Cell 47</li>
<li>Cell 48</li>
<li>Cell 49</li>
<li>Cell 50</li>
</ul>
</div>
</div>
<div id="footer"></div>
</body>
</html>