jquery-ui/demos/spinner/default.html

58 lines
1.3 KiB
HTML
Raw Normal View History

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>
<link rel="stylesheet" href="../../themes/base/all.css">
2011-08-07 16:59:50 +00:00
<link rel="stylesheet" href="../demos.css">
<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
$( "#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
});
$( "#destroy" ).on( "click", function() {
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
});
$( "#getvalue" ).on( "click", function() {
2011-08-07 16:59:50 +00:00
alert( spinner.spinner( "value" ) );
2011-08-07 15:34:28 +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>