2011-08-07 16:59:50 +00:00
|
|
|
<!doctype html>
|
2011-08-07 15:34:28 +00:00
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<title>jQuery UI Spinner - Default functionality</title>
|
2013-12-02 18:36:12 +00:00
|
|
|
<link rel="stylesheet" href="../../themes/base/all.css">
|
2014-06-10 11:55:45 +00:00
|
|
|
<script src="../../external/jquery/jquery.js"></script>
|
2012-07-12 15:34:55 +00:00
|
|
|
<script src="../../external/jquery.mousewheel.js"></script>
|
2013-12-02 18:36:12 +00:00
|
|
|
<script src="../../ui/core.js"></script>
|
|
|
|
<script src="../../ui/widget.js"></script>
|
|
|
|
<script src="../../ui/button.js"></script>
|
|
|
|
<script src="../../ui/spinner.js"></script>
|
2011-08-07 16:59:50 +00:00
|
|
|
<link rel="stylesheet" href="../demos.css">
|
|
|
|
<script>
|
2011-08-07 15:34:28 +00:00
|
|
|
$(function() {
|
2011-08-07 16:59:50 +00:00
|
|
|
var spinner = $( "#spinner" ).spinner();
|
2012-05-21 14:02:57 +00:00
|
|
|
|
|
|
|
$( "#disable" ).click(function() {
|
|
|
|
if ( spinner.spinner( "option", "disabled" ) ) {
|
|
|
|
spinner.spinner( "enable" );
|
|
|
|
} else {
|
|
|
|
spinner.spinner( "disable" );
|
|
|
|
}
|
2011-08-07 15:34:28 +00:00
|
|
|
});
|
2012-05-21 14:02:57 +00:00
|
|
|
$( "#destroy" ).click(function() {
|
2013-01-30 14:30:35 +00:00
|
|
|
if ( spinner.spinner( "instance" ) ) {
|
2012-05-21 14:02:57 +00:00
|
|
|
spinner.spinner( "destroy" );
|
|
|
|
} else {
|
|
|
|
spinner.spinner();
|
|
|
|
}
|
2011-08-07 15:34:28 +00:00
|
|
|
});
|
2011-08-07 16:59:50 +00:00
|
|
|
$( "#getvalue" ).click(function() {
|
|
|
|
alert( spinner.spinner( "value" ) );
|
2011-08-07 15:34:28 +00:00
|
|
|
});
|
2011-08-07 16:59:50 +00:00
|
|
|
$( "#setvalue" ).click(function() {
|
|
|
|
spinner.spinner( "value", 5 );
|
2011-08-07 15:34:28 +00:00
|
|
|
});
|
2011-08-07 16:59:50 +00:00
|
|
|
|
|
|
|
$( "button" ).button();
|
2011-08-07 15:34:28 +00:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
|
2011-08-07 16:59:50 +00:00
|
|
|
<p>
|
|
|
|
<label for="spinner">Select a value:</label>
|
|
|
|
<input id="spinner" name="value">
|
|
|
|
</p>
|
2011-08-07 15:34:28 +00:00
|
|
|
|
|
|
|
<p>
|
2011-08-07 16:59:50 +00:00
|
|
|
<button id="disable">Toggle disable/enable</button>
|
|
|
|
<button id="destroy">Toggle widget</button>
|
2011-08-07 15:34:28 +00:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
2011-08-07 16:59:50 +00:00
|
|
|
<button id="getvalue">Get value</button>
|
|
|
|
<button id="setvalue">Set value to 5</button>
|
2011-08-07 15:34:28 +00:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<div class="demo-description">
|
2011-08-07 16:59:50 +00:00
|
|
|
<p>Default spinner.</p>
|
2012-09-10 15:33:46 +00:00
|
|
|
</div>
|
2011-08-07 15:34:28 +00:00
|
|
|
</body>
|
|
|
|
</html>
|