jquery-ui/demos/spinner/default.html

68 lines
1.5 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>
2011-08-07 16:59:50 +00:00
<link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
2011-10-18 13:38:27 +00:00
<script src="../../jquery-1.6.4.js"></script>
2011-08-07 16:59:50 +00:00
<script src="../../external/jquery.mousewheel-3.0.4.js"></script>
<script src="../../ui/jquery.ui.core.js"></script>
<script src="../../ui/jquery.ui.widget.js"></script>
<script src="../../ui/jquery.ui.button.js"></script>
<script src="../../ui/jquery.ui.spinner.js"></script>
<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();
2011-08-07 15:34:28 +00:00
2011-08-07 16:59:50 +00:00
$( "#disable" ).toggle(function() {
spinner.spinner( "disable" );
2011-08-07 15:34:28 +00:00
}, function() {
2011-08-07 16:59:50 +00:00
spinner.spinner( "enable" );
2011-08-07 15:34:28 +00:00
});
2011-08-07 16:59:50 +00:00
$( "#destroy" ).toggle(function() {
spinner.spinner( "destroy" );
2011-08-07 15:34:28 +00:00
}, function() {
2011-08-07 16:59:50 +00:00
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>
<div class="demo">
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><!-- End demo -->
2011-08-07 16:59:50 +00:00
2011-08-07 15:34:28 +00:00
<div class="demo-description">
2011-08-07 16:59:50 +00:00
<p>Default spinner.</p>
2011-08-07 15:34:28 +00:00
</div><!-- End demo-description -->
</body>
</html>