forked from olton/metroui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsliders.html
More file actions
300 lines (286 loc) · 13.3 KB
/
sliders.html
File metadata and controls
300 lines (286 loc) · 13.3 KB
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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="description" content="Metro, a sleek, intuitive, and powerful framework for faster and easier web development for Windows Metro Style.">
<meta name="keywords" content="HTML, CSS, JS, JavaScript, framework, metro, front-end, frontend, web development">
<meta name="author" content="Sergey Pimenov and Metro UI CSS contributors">
<link rel='shortcut icon' type='image/x-icon' href='favicon.ico' />
<title>Slider :: Metro UI CSS - The front-end framework for developing projects on the web in Windows Metro Style</title>
<link href="css/metro.css" rel="stylesheet">
<link href="css/metro-icons.css" rel="stylesheet">
<link href="css/docs.css" rel="stylesheet">
<script src="js/jquery-2.1.3.min.js"></script>
<script src="js/metro.js"></script>
<script src="js/docs.js"></script>
<script src="js/prettify/run_prettify.js"></script>
<script src="js/ga.js"></script>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
</head>
<body onload="init()">
<div class="container page-content">
<h1><a href="index.html" class="nav-button transform"><span></span></a> Slider</h1>
@@adsense
<div class="example" data-text="example">
<div class="grid">
<div class="row cells4">
<div class="cell">
<h5>Default</h5>
<div class="slider" data-role="slider"></div>
</div>
<div class="cell">
<h5>With hint</h5>
<div class="slider" data-role="slider" data-show-hint="true" data-position="35"></div>
</div>
<div class="cell">
<h5>Customize</h5>
<div class="slider" data-role="slider" data-complete-color="ribbed-green" data-marker-color="bg-cyan" data-color="bg-lightRed"></div>
</div>
<div class="cell">
<h5>Accuracy mode</h5>
<div class="slider" data-accuracy="10" data-role="slider" data-complete-color="ribbed-red" data-marker-color="blue" data-show-hint="true"></div>
</div>
</div>
<h3>Large size</h3>
<div class="row cells4">
<div class="cell">
<h5>Default</h5>
<div class="slider large" data-role="slider"></div>
</div>
<div class="cell">
<h5>min(max)Value</h5>
<div class="slider large" data-on-change="showSliderChange" data-role="slider" data-show-hint="true" data-position="35" data-permanent-hint="true" data-hint-position="bottom" data-max-value="1000" data-min-value="-300"></div>
<script>
function showSliderChange(value, slider){
console.log(value);
}
</script>
</div>
<div class="cell">
<h5>Customize</h5>
<div class="slider large" data-role="slider" data-complete-color="ribbed-green" data-marker-color="bg-yellow" data-color="ribbed-red"></div>
</div>
<div class="cell">
<h5>Accuracy mode</h5>
<div class="slider large" data-accuracy="10" data-role="slider" data-complete-color="ribbed-red" data-marker-color="blue" data-show-hint="true"></div>
</div>
</div>
<div class="row cells4">
<div class="cell">
<h5>Vertical</h5>
<div class="slider" data-role="slider" data-vertical="true"></div>
<div class="slider" data-role="slider" data-vertical="true" data-position="30"></div>
<div class="slider" data-role="slider" data-vertical="true" data-colors="red, yellow, green"></div>
<div class="slider" data-role="slider" data-vertical="true" data-position="75" data-show-hint="true"></div>
<div class="slider large" data-role="slider" data-vertical="true" data-position="75" data-show-hint="true" data-permanent-hint="true"></div>
</div>
<div class="cell">
<h5>Vertical With hint</h5>
<div class="slider" data-role="slider" data-show-hint="true" data-vertical="true"></div>
</div>
<div class="cell">
<h5>Vertical Customize</h5>
<div class="slider" data-role="slider" data-complete-color="ribbed-red" data-marker-color="blue" data-vertical="true"></div>
</div>
<div class="cell">
<h5>Accuracy mode</h5>
<div class="slider" data-accuracy="10" data-role="slider" data-complete-color="ribbed-red" data-vertical="true" data-show-hint="true"></div>
</div>
</div>
<div class="row">
<div class="cell">
<h5>Put slider value to input on event data-on-*</h5>
<div class="slider large" data-on-change="dropValueToInput" data-role="slider" data-max-value="1000" data-min-value="0"></div>
<div class="input-control text">
<input id="slider_input" value="0">
</div>
<script>
function dropValueToInput(value, slider){
$("#slider_input").val(value);
}
</script>
<pre class="prettyprint linenums"><code>
<div class="slider large"
data-on-change="dropValueToInput"
data-role="slider"
data-max-value="1000"
data-min-value="0"></div>
<div class="input-control text">
<input id="slider_input" value="0">
</div>
<script>
function dropValueToInput(value, slider){
$("#slider_input").val(value);
}
</script>
</code></pre>
<h5>Put slider value to input on data-target</h5>
<div class="slider large" data-target="#slider_input2" data-role="slider" data-max-value="1000" data-min-value="0"></div>
<div class="input-control text">
<input id="slider_input2" value="0">
</div>
<pre class="prettyprint linenums"><code>
<div class="slider large"
data-target="#slider_input"
data-role="slider"
data-max-value="1000"
data-min-value="0"></div>
<div class="input-control text">
<input id="slider_input" value="0">
</div>
</code></pre>
</div>
</div>
</div>
</div> <!-- End of example -->
<div class="example" data-text="code">
<h5>Declarative style</h5>
<pre class="prettyprint linenums"><code>
<div class="slider" data-role="slider"></div>
</code></pre>
<h5>Javascript style</h5>
<pre class="prettyprint linenums"><code>
<div class="slider" id="slider"></div>
<script>
$(function(){
$("#slider").slider();
});
</script>
</code></pre>
</div>
<h3>Options</h3>
<table class="table bordered border">
<thead>
<tr>
<td>Parameter</td>
<td>Data-*</td>
<td>Type</td>
<td>Default value</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>position</td>
<td style="white-space: nowrap">data-position</td>
<td>int</td>
<td>0</td>
<td>Init position for slider</td>
</tr>
<tr>
<td>accuracy</td>
<td style="white-space: nowrap">data-accuracy</td>
<td>int</td>
<td>0</td>
<td>Accuracy for slider change value</td>
</tr>
<tr>
<td>color</td>
<td style="white-space: nowrap">data-color</td>
<td>string</td>
<td>default</td>
<td>Slider panel color (background). Can be hex color or class name</td>
</tr>
<tr>
<td>completeColor</td>
<td style="white-space: nowrap">data-complete-color</td>
<td>string</td>
<td>default</td>
<td>Slider complete color (background). Can be hex color or class name</td>
</tr>
<tr>
<td>markerColor</td>
<td style="white-space: nowrap">data-marker-color</td>
<td>string</td>
<td>default</td>
<td>Slider marker color (background). Can be hex color or class name</td>
</tr>
<tr>
<td>showHint</td>
<td style="white-space: nowrap">data-show-hint</td>
<td>boolean</td>
<td>false</td>
<td>Show or hide hint for value when slider change value</td>
</tr>
<tr>
<td>permanentHint</td>
<td style="white-space: nowrap">data-permanent-hint</td>
<td>boolean</td>
<td>false</td>
<td>If this value is true and showHint is true hint visible in permanent mode</td>
</tr>
<tr>
<td>vertical</td>
<td style="white-space: nowrap">data-vertical</td>
<td>boolean</td>
<td>false</td>
<td>Show slider in vertical mode</td>
</tr>
<tr>
<td>minValue</td>
<td style="white-space: nowrap">data-min-value</td>
<td>int</td>
<td>0</td>
<td>Min slider value</td>
</tr>
<tr>
<td>maxValue</td>
<td style="white-space: nowrap">data-max-value</td>
<td>int</td>
<td>100</td>
<td>Max slider value</td>
</tr>
<tr>
<td>returnType</td>
<td style="white-space: nowrap">data-return-type</td>
<td>string</td>
<td>value</td>
<td>Type of returned value: real value or percent</td>
</tr>
<tr>
<td>animate</td>
<td style="white-space: nowrap">data-animate</td>
<td>boolean</td>
<td>true</td>
<td>Animated slider marker moving when user click on slider</td>
</tr>
<tr>
<td>colors</td>
<td style="white-space: nowrap">data-colors</td>
<td>string with comma delimiter</td>
<td>false</td>
<td>Defines a set of colors that will be applied uniformly to complete color when marker is moving</td>
</tr>
</tbody>
</table>
<h3>Events</h3>
<table class="table bordered border">
<thead>
<tr>
<td>Event</td>
<td>Data-*</td>
<td>Params</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>onChange</td>
<td style="white-space: nowrap">data-on-change</td>
<td>(value, slide)</td>
<td>The event fired when the user change slider marker position</td>
</tr>
<tr>
<td>onChanged</td>
<td style="white-space: nowrap">data-on-changed</td>
<td>(index, itemHTML)</td>
<td>The event fired when slider value changed</td>
</tr>
</tbody>
</table>
</div>
@@hit
</body>
</html>