-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
62 lines (52 loc) · 2.25 KB
/
index.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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="ru">
<head>
<title>jQuery Time Slider</title>
<link rel="stylesheet" type="text/css" href="jquery.time.slider.css" />
</head>
<body>
<h1>jQuery Time Slider</h1>
<p>
This is a demo of jQuery plugin that supports choosing of the time using dragging of slider.
</p>
<fieldset><legend>Change event listener</legend>
Time is <span id="chosen-time"></span>
</fieldset>
<fieldset><legend>Span to be converted into time slider</legend>
<label>Time slider span: <span class="timepick">5:00</span></label>
</fieldset>
<fieldset><legend>Input field to be converted into time slider</legend>
<p><label>Time slider: <input type="text" class="timepick" size="5" maxlength="5" /></label></p>
</fieldset>
<fieldset><legend>Input field to be converted into time slider with not shown value</legend>
<p><label>Time slider: <input type="text" class="timepick2" value="5:00" /></label></p>
</fieldset>
<fieldset><legend>Actions</legend>
<input type="button" id="toggler" value="Toggle time sliders" />
<div id="chain-test"></div>
</fieldset>
<fieldset><legend>Source code</legend>
<script src="http://gist.github.com/517176.js?file=Example-of-usage-jquery-time-slider.js"></script>
</fieldset>
<p>Repository: <a href="http://github.com/akzhan/jquery-time-slider">http://github.com/akzhan/jquery-time-slider</a>.</p>
Images © <a href="http://maps.google.com/">Google Maps</a> team.
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script type="text/javascript" src="jquery.time.slider.js"></script>
<script type="text/javascript">
(function($)
{
$('.timepick').change(function()
{
$('#chosen-time').text($(this).timeslider('get').toString());
}).timeslider({value: '12:00'});
$('#toggler').click(function(e)
{
e.preventDefault();
$('.timepick,.timepick2').timeslider('toggle').addClass('chain-ok');
$('#chain-test').text($('.timepick,.timepick2').not('.chain-ok').size() > 0 ? 'chain test failed' : 'chain test passed');
});
$('.timepick2').timeslider({ showValue: false, clickable: true });
})(jQuery);
</script>
</body>
</html>