-
Notifications
You must be signed in to change notification settings - Fork 1
/
spinnerWidget.html
29 lines (29 loc) · 1017 Bytes
/
spinnerWidget.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
<html>
<head>
<title></title>
<script src="jquery-1.7.1.js" type="text/javascript"></script>
<script src="jquery-ui-1.8.16.js" type="text/javascript"></script>
<script src="jquery.ui.counter.js" type="text/javascript"></script>
<style type="text/css">
#button.hover{background-color:darkgrey,color:grey,border:2px solid grey,box-shadow:3px 3px blue;}
#button{border:2px solid darkgrey;background-color:grey;color:white;text-align:center;padding:5px;cursor:pointer;width:50px;}
</style>
</head>
<body>
<div style="background-color:#e7e7e7;padding:10px;clear:both;width:300px;">
<div id="sp" class="counter"></div>
</div>
<input type="text" id="num"/><div id="button">change</div>
</body>
<script type="text/javascript">
var $counter;
$(function(){
$counter=$("div#sp").counter({number:11234, imgWidth:'12px'});
$("#button").click(function(){
var n=$("#num").val()*1;
if(n!==null && (typeof n !== "undefined") && n!==NaN)
$("div#sp").data("counter").change(n);
});
});
</script>
</html>