Debian Codegraph @

demos/carousel/index.html

raw symbols SCIP
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
6
7 <title>iScroll demo: carousel</title>
8
9 <script type="text/javascript" src="../../build/iscroll.js"></script>
10
11 <script type="text/javascript">
12
13 var myScroll;
14
15 function loaded () {
16 myScroll = new IScroll('#wrapper', {
17 scrollX: true,
18 scrollY: false,
19 momentum: false,
20 snap: true,
21 snapSpeed: 400,
22 keyBindings: true,
23 indicators: {
24 el: document.getElementById('indicator'),
25 resize: false
26 }
27 });
28 }
29
30 document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);
31 </script>
32
33 <style type="text/css">
34 * {
35 -webkit-box-sizing: border-box;
36 -moz-box-sizing: border-box;
37 box-sizing: border-box;
38 }
39
40 html {
41 -ms-touch-action: none;
42 }
43
44 body, ul, li {
45 padding: 0;
46 margin: 0;
47 border: 0;
48 }
49
50 body {
51 font-size: 12px;
52 font-family: ubuntu, helvetica, arial;
53 overflow: hidden; /* this is important to prevent the whole page to bounce */
54 }
55
56 #viewport {
57 position: relative;
58 width: 320px;
59 height: 240px;
60 margin: 0 auto;
61 background: #444;
62 overflow: hidden;
63 }
64
65 #wrapper {
66 width: 200px;
67 height: 240px;
68 margin: 0 auto;
69 }
70
71 #scroller {
72 position: absolute;
73 z-index: 1;
74 -webkit-tap-highlight-color: rgba(0,0,0,0);
75 width: 800px;
76 height: 240px;
77 -webkit-transform: translateZ(0);
78 -moz-transform: translateZ(0);
79 -ms-transform: translateZ(0);
80 -o-transform: translateZ(0);
81 transform: translateZ(0);
82 -webkit-touch-callout: none;
83 -webkit-user-select: none;
84 -moz-user-select: none;
85 -ms-user-select: none;
86 user-select: none;
87 -webkit-text-size-adjust: none;
88 -moz-text-size-adjust: none;
89 -ms-text-size-adjust: none;
90 -o-text-size-adjust: none;
91 text-size-adjust: none;
92 background-color: #444;
93 }
94
95 .slide {
96 width: 200px;
97 height: 240px;
98 float: left;
99 }
100
101 .painting {
102 width: 140px;
103 height: 200px;
104 border-radius: 10px;
105 margin: 20px auto;
106 border: 1px solid #000;
107 box-shadow:
108 inset 2px 2px 6px rgba(255,255,255,0.6),
109 inset -2px -2px 6px rgba(0,0,0,0.6),
110 0 1px 8px rgba(0,0,0,0.8);
111 }
112
113 .giotto {
114 background: url(giotto.jpg);
115 }
116
117 .leonardo {
118 background: url(leonardo.jpg);
119 }
120
121 .gaugin {
122 background: url(gaugin.jpg);
123 }
124
125 .warhol {
126 background: url(warhol.jpg);
127 }
128
129 #indicator {
130 position: relative;
131 width: 110px;
132 height: 20px;
133 margin: 10px auto;
134 background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAUBAMAAABohZD3AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3QUGCDYztyDUJgAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUHAAAAGFBMVEUAAADNzc3Nzc3Nzc3Nzc3Nzc3Nzc3///8aWwwLAAAABnRSTlMAX5Ks3/nRD0HIAAAAAWJLR0QHFmGI6wAAAFtJREFUGFdjYGBgEHYNMWRAAJE0IHCEc5nSwEABxleD8JOgXMY0KBCA8FlgfAcIXwzGT4TwzWD8ZAjfDcZPgfDDYPxU7Hx09ejmoduH7h5096L7B8O/6OGBGl4APYg8TQ0XAScAAAAASUVORK5CYII=);
135 }
136
137 #dotty {
138 position: absolute;
139 width: 20px;
140 height: 20px;
141 border-radius: 10px;
142 background: #777;
143 }
144
145 </style>
146 </head>
147 <body onload="loaded()">
148
149 <div id="viewport">
150 <div id="wrapper">
151 <div id="scroller">
152 <div class="slide">
153 <div class="painting giotto"></div>
154 </div>
155 <div class="slide">
156 <div class="painting leonardo"></div>
157 </div>
158 <div class="slide">
159 <div class="painting gaugin"></div>
160 </div>
161 <div class="slide">
162 <div class="painting warhol"></div>
163 </div>
164 </div>
165 </div>
166 </div>
167
168 <div id="indicator">
169 <div id="dotty"></div>
170 </div>
171
172 </body>
173 </html>