-
Notifications
You must be signed in to change notification settings - Fork 0
/
circular-slider.html
298 lines (267 loc) · 14.8 KB
/
circular-slider.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
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
<!DOCTYPE HTML>
<html manifest="/circular-slider.appcache">
<head>
<title> Circular Slider - A JQuery Plugin | JS | toolitup.com</title>
<meta charset="UTF-8">
<meta name="description" content="Circular slider is a jQuery plugin for range values and image carousel. It supports half and full circluar sliders.">
<meta name="robots" content="INDEX, FOLLOW, NOODP" />
<meta name="keywords" content="jquery, slider, circular slider, circular-slider.js, image carousel, half circle, github/circular-slider" >
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=0.25, minimum-scale=0.1, maximum-scale=2.0, user-scalable=1" />
<meta property="og:title" content="Circular Slider - A JQuery Plugin | JS | toolitup.com" />
<meta property="og:image" content="assets/images/logo.png" />
<meta property="og:description" content="Circular slider is a jquery plugin for range values and image carousel. It supports half and full circluar sliders." />
<meta property="og:site_name" content="toolitup" />
<link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<link rel="canonical" href="http://www.toolitup.com/circular-slider.html" />
<link rel="shortcut icon" href="favicon.png" type="image/png">
<link rel="icon" href="favicon.png" type="image/png">
<link rel="stylesheet" href="assets/css/circular-slider.min.css" />
<link rel="stylesheet" href="assets/css/toolitup-circular-slider.css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="assets/js/jquery.ui.touch-punch.min.js"></script>
</head>
<body>
<div id="fb-root"> </div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '791808880883628',
xfbml : true,
version : 'v2.1'
});
};
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "http://connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
<div class="cs-container">
<div class="cs-row">
<a href="http://www.toolitup.com" class="t-logo">
<img src="assets/images/logo.png" alt="ToolitUp.com" >
</a>
<div class='cs-header'>
<h3 class="cs-prefix">$</h3>
<h3 class="cs-title">Circular Slider </h3>
<h3 class="cs-connect">|</h3>
<h3 class="cs-title">A JQuery Plugin</h3>
</div>
<div class='t-social' data-like="❤ ❤ ❤">
<a href="https://twitter.com/share" class="twitter-share-button" data-count="vertical" data-url="http://www.toolitup.com/circular-slider.html" data-text="Circular Slider - A JQuery Plugin | JS | toolitup.com" data-hashtags="javascript,jQuery,jQuery-toolitup">Tweet</a>
<g:plusone size="tall" data-href="http://www.toolitup.com/circular-slider.html" ></g:plusone>
<script src="http://platform.linkedin.com/in.js" type="text/javascript">
lang: en_US
</script>
<script type="IN/Share" data-url="http://www.toolitup.com/circular-slider.html" data-counter="top"></script>
<div class="fb-like" data-href="http://www.toolitup.com/circular-slider.html" data-layout="box_count" data-action="like" data-width="60" data-show-faces="true" data-share="false"></div>
</div>
</div>
<ul id="menu">
<li data-menuanchor="cs-demo-1"><span data-link="#FullCircle">Circle</span></li>
<li data-menuanchor="cs-demo-2"><span data-link="#HalfCircle">1/2 Circle</span></li>
<li data-menuanchor="cs-demo-3"><span data-link="#HalfCircleRight">1/2 Circle Right</span></li>
<li data-menuanchor="cs-demo-4"><span data-link="#HalfCircleLeft">1/2 Circle Left</span></li>
<li data-menuanchor="cs-demo-5"><span data-link="#HalfCircleBottom">1/2 Circle Bottom</span></li>
<li data-menuanchor="cs-demo-6"><span data-link="#Customized">Image Carousel</a></li>
</ul>
<div class="cs-demo">
<div class='cs-demo-1'>
<div id='slider-full'>
</div>
<code class='cs-jscode'>
<pre>
<span class='js-keyword'>
var </span>circularSlider = $(<span class='js-literal'>'#slider'</span>).CircularSlider({
min : <span class='js-value'>0</span>,
max: <span class='js-value'>359</span>,
value : <span class='js-value'>10</span>,
labelSuffix: <span class='js-literal'>"°"</span>,
slide : <span class='js-keyword'>function</span>(value) {
ui.next().css({<span class='js-literal'>'background'</span> : <span class='js-value'>'linear-gradient('</span> + value +
<span class='js-value'>'deg, white, cornsilk, white)'</span>});
}
});
</pre>
</code>
</div>
</div>
<div class="cs-demo">
<div class='cs-demo-2'>
<div id='slider-half-circle'>
</div>
<code class='cs-jscode'>
<pre>
<span class='js-keyword'>
var </span>halfCircularSlider = $(<span class='js-literal'>'#slider'</span>).CircularSlider({
min : <span class='js-value'>0</span>,
max: <span class='js-value'>100</span>,
value : <span class='js-value'>60</span>,
labelSuffix: <span class='js-literal'>"%"</span>,
shape: <span class='js-literal'>"Half Circle"</span>,
slide : <span class='js-keyword'>function</span>(value) {
if (value < 50) {
ui.next().css({<span class='js-literal'>'background'</span> : <span class='js-value'>'rgba(250, 81, 81,'</span> + ((100 - value) / 100) + <span class='js-value'>')'</span>});
} else {
ui.next().css({<span class='js-literal'>'background'</span> : <span class='js-value'>'rgba(87, 250, 87,'</span> + (value / 100) + <span class='js-value'>')'</span>});
}
}
});
</pre>
</code>
</div>
</div>
<div class="cs-demo">
<div class='cs-demo-3'>
<div id='slider-half-circle-right'>
</div>
<code class='cs-jscode'>
<pre>
<span class='js-keyword'>
var </span>halfRightCircularSlider = $(<span class='js-literal'>'#slider'</span>).CircularSlider({
min : <span class='js-value'>0</span>,
max: <span class='js-value'>100</span>,
value : <span class='js-value'>40</span>,
labelSuffix: <span class='js-literal'>"kph"</span>,
shape: <span class='js-literal'>"Half Circle Right"</span>,
slide : <span class='js-keyword'>function</span>(value) {
<span class='js-keyword'>var</span> alpha = value / 100;
if (value <= 50) {
ui.next().css({<span class='js-literal'>'background'</span> : <span class='js-value'>'rgba(255, 235, 0,'</span> + alpha + <span class='js-value'>')'</span>});
} else if (value <= 80) {
ui.next().css({<span class='js-literal'>'background'</span> : <span class='js-value'>'rgba(87, 250, 87,'</span> + alpha + <span class='js-value'>')'</span>});
} else {
ui.next().css({<span class='js-literal'>'background'</span> : <span class='js-value'>'rgba(250, 81, 81,'</span> + alpha + <span class='js-value'>')'</span>});
}
}
});
</pre>
</code>
</div>
</div>
<div class="cs-demo">
<div class='cs-demo-4'>
<div id='slider-half-circle-left'>
</div>
<code class='cs-jscode'>
<pre>
<span class='js-keyword'>
var </span>halfLeftCircularSlider = $(<span class='js-literal'>'#slider'</span>).CircularSlider({
min : <span class='js-value'>0</span>,
max: <span class='js-value'>100</span>,
value : <span class='js-value'>40</span>,
labelSuffix: <span class='js-literal'>"kph"</span>,
shape: <span class='js-literal'>"Half Circle Left"</span>,
slide : <span class='js-keyword'>function</span>(value) {
<span class='js-keyword'>var</span> alpha = value / 100;
if (value <= 50) {
ui.next().css({<span class='js-literal'>'background'</span> : <span class='js-value'>'rgba(255, 235, 0,'</span> + alpha + <span class='js-value'>')'</span>});
} else if (value <= 80) {
ui.next().css({<span class='js-literal'>'background'</span> : <span class='js-value'>'rgba(87, 250, 87,'</span> + alpha + <span class='js-value'>')'</span>});
} else {
ui.next().css({<span class='js-literal'>'background'</span> : <span class='js-value'>'rgba(250, 81, 81,'</span> + alpha + <span class='js-value'>')'</span>});
}
}
});
</pre>
</code>
</div>
</div>
<div class="cs-demo">
<div class='cs-demo-5'>
<div id='slider-half-circle-bottom'>
</div>
<code class='cs-jscode'>
<pre>
<span class='js-keyword'>
var </span>halfBottomCircularSlider = $(<span class='js-literal'>'#slider'</span>).CircularSlider({
min : <span class='js-value'>-50</span>,
max: <span class='js-value'>50</span>,
value : <span class='js-value'>20</span>,
labelPrefix: <span class='js-literal'>"▽"</span>,
slide : <span class='js-keyword'>function</span>(value) {
<span class='js-keyword'>var</span> alpha = Math.abs(value) / 100;
ui.next().css({<span class='js-literal'>'background'</span> : <span class='js-value'>'rgba(7, 154, 252,'</span> + alpha + <span class='js-value'>')'</span>});
}
});
</pre>
</code>
</div>
</div>
<div class="cs-demo">
<div class='cs-demo-6'>
<div id='slider-customized'>
</div>
<code class='cs-jscode'>
<pre>
<span class='js-keyword'>
var </span>imageSlider = $(<span class='js-literal'>'#slider'</span>).CircularSlider({
min : <span class='js-value'>0</span>,
max: <span class='js-value'>359</span>,
radius: <span class='js-value'>100</span>,
innerCircleRatio: <span class='js-value'>0.7</span>,
formLabel : <span class='js-keyword'>function</span>(value, prefix, suffix) {
<span class='js-keyword'>return</span> <span class='js-literal'>'<img src="assets/images/baby'</span> + parseInt(value / 23) + <span class='js-literal'>'.png"></img>'</span>;
},
slide : <span class='js-keyword'>function</span>(ui, value) {
<span class='js-keyword'>var</span> colors = [<span class='js-literal'>'deeppink'</span>, <span class='js-literal'>'seagreen'</span>, <span class='js-literal'>'deepskyblue'</span>,<span class='js-literal'>'coral'</span>, <span class='js-literal'>'cadetblue'</span>, <span class='js-literal'>'olive'</span>,<span class='js-literal'>'chocolate'</span>, <span class='js-literal'>'yellowgreen'</span>, <span class='js-literal'>'cornflowerblue'</span>,<span class='js-literal'>'slategrey'</span>, <span class='js-literal'>'salmon'</span>, <span class='js-literal'>'brown'</span>,<span class='js-literal'>darkgoldenrod'</span>, <span class='js-literal'>'dimgrey'</span>];
<span class='js-keyword'>var</span> color = colors[parseInt(value / 23)];
ui.find(<span class='js-literal'>'.jcs'</span>).css({<span class='js-literal'>'border-color'</span> : color });
ui.find(<span class='js-literal'>'.jcs-indicator'</span>).css({<span class='js-literal'>'background'</span> : color });
}
});
</pre>
</code>
</div>
</div>
<div class='t-comments'>
<div class="cs-row">
<span id="forkongithub"><a href="https://github.com/princejwesley/circular-slider"><i class="fa fa-github"></i> fork me</a></span>
</div>
<!--
Disqus comments
-->
<div id="disqus_thread"></div>
<script type="text/javascript">
var disqus_shortname = 'toolitup';
var disqus_identifier = '/js/circular-slider';
var disqus_title = "Circular Slider - A JQuery Plugin | JS | toolitup.com";
var disqus_url = "http://www.toolitup.com/js/circular-slider.html";
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
</div>
</div>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-55005923-1', 'auto');
ga('require', 'displayfeatures');
ga('send', 'pageview');
</script>
<script type="text/javascript">
window.___gcfg = {
lang: 'en-US'
};
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
<script src="assets/js/circular-slider.min.js"></script>
<script src="assets/js/toolitup-circular-slider.min.js"></script>
</body>
</html>