aboutsummaryrefslogtreecommitdiffstats
path: root/tests/visual/spinner.html
blob: af8d8a8ad8d7c336a09c907ec789737df882dc05 (plain)
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jQuery UI Spinner Test page</title>
<script type="text/javascript" src="../../jquery-1.2.6.js"></script>
<script type="text/javascript" src="../../ui/ui.core.js"></script>
<script type="text/javascript" src="../../ui/ui.spinner.js"></script>


<script type="text/javascript">
$(function(){

	var opts = {
		's1': {},
		's2': {stepping: 0.25},
		's3': {currency: '$'},
		's4': {}
	};

	for (var n in opts)
		$("#"+n).spinner(opts[n]);

	$("button").click(function(e){
		var ns = $(this).attr('id').match(/(s\d)\-(\w+)$/);
		if (ns != null)
			$('#'+ns[1]).spinner( (ns[2] == 'create') ? opts[ns[1]] : ns[2]);
	});

});
</script>

<style type="text/css">
body
{
	background: #fff;
	font-family: Arial;
}

label {
	float: left;
	margin-right: .5em;
	padding: .15em 0;
	font-weight: bold;
}

.ui-spinner {
	width: 15em;
	display: block;
	position: relative;
	overflow: hidden;
	border: 1px solid #999;
	background: #FEFEFE url(../images/spinner-bg.gif) repeat-x left bottom;
	padding: 0 5px;
}

.ui-spinner-disabled {
	background: #F4F4F4;
	color: #CCC;
}

.ui-spinner-box {
	width: 90%;
	height: 100%;
	float: left;
	font-size: 125%;
	border: none;
	background: none;
	padding: 0;
}

.ui-spinner-up,
.ui-spinner-down {
	width: 10%;
	height: 50%;
	font-size: 0.5em;
	padding: 0;
	margin: 0;
	z-index: 100;
	text-align: center;
	vertical-align: middle;
	position: absolute;
	right: 0;
	cursor: default;
	border: 1px solid #999;
	border-right: none;
	border-top: none;
}

.ui-spinner-down {
	bottom: 0;
	border-bottom: 0;
}

.ui-spinner-pressed {
	background: #FEFEFE;
}

.ui-spinner-list {
	height: 1.2em;
	line-height: 1.2em;
	margin: 0;
	padding: 0;
}

.ui-spinner-listitem {
	margin: 0;
	padding: 0;
}

</style>
</head>

<body>

<h1>jQuery UI Spinner Test Page</h1>

<p>This is a visual test page for developers and demonstrates some of the features included in ui.spinner. Mousewheel support is provided by the <a href="http://plugins.jquery.com/project/mousewheel">mousewheel plugin</a>.</p>

<p><label for="s1">Basic: </label>
<input type="text" id="s1" value="10" /></p>

<p>
<button id="s1-disable">disable</button>
<button id="s1-enable">enable</button>
<button id="s1-destroy">destroy</button>
<button id="s1-create">create</button>
</p>

<hr />

<p><label for="s2">Decimal: </label>
<input type="text" id="s2" value="10.25" /></p>

<p>
<button id="s2-disable">disable</button>
<button id="s2-enable">enable</button>
<button id="s2-destroy">destroy</button>
<button id="s2-create">create</button>
</p>

<hr />

<p><label for="s3">Currency: </label>
<input type="text" id="s3" /></p>

<p>
<button id="s3-disable">disable</button>
<button id="s3-enable">enable</button>
<button id="s3-destroy">destroy</button>
<button id="s3-create">create</button>
</p>

<hr />

<p><label for="s4">Data List: </label>
<ul id="s4">
	<li>item 1</li>
	<li>item 2</li>
	<li>item 3</li>
	<li>item 4</li>
	<li>item 5</li>
	<li>item 6</li>
	<li>item 7</li>
	<li>item 8</li>
	<li>item 9</li>
	<li>item 10</li>
	<li>item 11</li>
	<li>item 12</li>
	<li>item 13</li>
	<li>item 14</li>
	<li>item 15</li>
	<li>item 16</li>
	<li>item 17</li>
	<li>item 18</li>
	<li>item 19</li>
	<li>item 20</li>
</ul>

<p>
<button id="s4-disable">disable</button>
<button id="s4-enable">enable</button>
<button id="s4-destroy">destroy</button>
<button id="s4-create">create</button>
</p>

<hr />


</body>
</html>