forked from vsn4ik/input-spinner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.html
93 lines (86 loc) · 3.6 KB
/
example.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
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Example</title>
<link href="http://netdna.bootstrapcdn.com/bootstrap/2.3.2/css/bootstrap.min.css" rel="stylesheet">
<link href="http://netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.min.css" rel="stylesheet">
<link href="dist/bootstrap-spinner.css" rel="stylesheet">
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://netdna.bootstrapcdn.com/bootstrap/2.3.2/js/bootstrap.min.js"></script>
<script src="dist/jquery.spinner.js"></script>
<script type="text/javascript">
$(function(){
$('#customize-spinner').spinner('changed',function(e, newVal, oldVal){
$('#old-val').text(oldVal);
$('#new-val').text(newVal);
});
})
</script>
</head>
<body>
<div class="container">
<h1>Examples for jQuery spinner</h1>
<ul class="muted">
<li>Arrow-up for increment</li>
<li>Arrow-down for decrement</li>
<li>Press Arrows or Left-mouse cause continuous changing</li>
</ul>
<div class="well">
<h2>Quantity:</h2>
<div class="input-append spinner" data-trigger="spinner">
<input type="text" value="1" data-rule="quantity">
<div class="add-on">
<a href="javascript:;" class="spin-up" data-spin="up"><i class="icon-sort-up"></i></a>
<a href="javascript:;" class="spin-down" data-spin="down"><i class="icon-sort-down"></i></a>
</div>
</div>
</div>
<div class="well">
<h2>Currency:</h2>
<div class="input-append spinner" data-trigger="spinner">
<input type="text" value="1" data-rule="currency">
<div class="add-on">
<a href="javascript:;" class="spin-up" data-spin="up"><i class="icon-sort-up"></i></a>
<a href="javascript:;" class="spin-down" data-spin="down"><i class="icon-sort-down"></i></a>
</div>
</div>
</div>
<div class="well">
<h2>Percent:</h2>
<div class="input-append spinner" data-trigger="spinner">
<input type="text" value="1" data-rule="percent">
<div class="add-on">
<a href="javascript:;" class="spin-up" data-spin="up"><i class="icon-sort-up"></i></a>
<a href="javascript:;" class="spin-down" data-spin="down"><i class="icon-sort-down"></i></a>
</div>
</div>
</div>
<div class="well">
<h2>Month:</h2>
<div class="input-append spinner" data-trigger="spinner">
<input type="text" value="1" data-rule="month">
<div class="add-on">
<a href="javascript:;" class="spin-up" data-spin="up"><i class="icon-sort-up"></i></a>
<a href="javascript:;" class="spin-down" data-spin="down"><i class="icon-sort-down"></i></a>
</div>
</div>
</div>
<div class="well">
<h2>Customize(even number less than 200):</h2>
<div class="input-append spinner" data-trigger="spinner" id="customize-spinner">
<input type="text" value="0" data-max="200" data-min="0" data-step="2">
<div class="add-on">
<a href="javascript:;" class="spin-up" data-spin="up"><i class="icon-sort-up"></i></a>
<a href="javascript:;" class="spin-down" data-spin="down"><i class="icon-sort-down"></i></a>
</div>
</div>
<p>Event handler: changed</p>
<p>
Old = <span id="old-val"></span>, New = <span id="new-val"></span>
</p>
</div>
</div>
</body>
</html>