jquery-ui/demos/spinner/default.html

65 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>
<link rel="stylesheet" href="../../themes/base/all.css">
<script src="../../external/jquery/jquery.js"></script>
<script src="../../external/jquery-mousewheel/jquery.mousewheel.js"></script>
<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() {
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>