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">
|
2011-08-07 16:59:50 +00:00
|
|
|
<link rel="stylesheet" href="../demos.css">
|
2015-07-01 03:34:08 +00:00
|
|
|
<script src="../../external/requirejs/require.js"></script>
|
|
|
|
<script src="../bootstrap.js" data-modules="external/jquery-mousewheel/jquery.mousewheel">
|
2011-08-07 16:59:50 +00:00
|
|
|
var spinner = $( "#spinner" ).spinner();
|
2012-05-21 14:02:57 +00:00
|
|
|
|
2015-05-14 02:01:44 +00:00
|
|
|
$( "#disable" ).on( "click", function() {
|
2012-05-21 14:02:57 +00:00
|
|
|
if ( spinner.spinner( "option", "disabled" ) ) {
|
|
|
|
spinner.spinner( "enable" );
|
|
|
|
} else {
|
|
|
|
spinner.spinner( "disable" );
|
|
|
|
}
|
2011-08-07 15:34:28 +00:00
|
|
|
});
|
2015-05-14 02:01:44 +00:00
|
|
|
$( "#destroy" ).on( "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
|
|
|
});
|
2015-05-14 02:01:44 +00:00
|
|
|
$( "#getvalue" ).on( "click", function() {
|
2011-08-07 16:59:50 +00:00
|
|
|
alert( spinner.spinner( "value" ) );
|
2011-08-07 15:34:28 +00:00
|
|
|
});
|
2015-05-14 02:01:44 +00:00
|
|
|
$( "#setvalue" ).on( "click", function() {
|
2011-08-07 16:59:50 +00:00
|
|
|
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>
|