jquery-ui/demos/spinner/overflow.html

52 lines
1.2 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">
2011-08-07 16:59:50 +00:00
<title>jQuery UI Spinner - Overflow</title>
<link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
<script src="../../jquery-1.6.2.js"></script>
<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
$( "#spinner" ).spinner({
spin: function( event, ui ) {
if ( ui.value > 10 ) {
$( this ).spinner( "value", -10 );
2011-08-07 15:34:28 +00:00
return false;
2011-08-07 16:59:50 +00:00
} else if ( ui.value < -10 ) {
$( this ).spinner( "value", 10 );
2011-08-07 15:34:28 +00:00
return false;
}
}
});
});
</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>
</div><!-- End demo -->
2011-08-07 15:34:28 +00:00
<div class="demo-description">
2011-08-07 16:59:50 +00:00
<p>
Overflowing spinner restricted to a range of -10 to 10.
For anything above 10, it'll overflow to -10, and the other way round.
</p>
</div><!-- End demo-description -->
2011-08-07 15:34:28 +00:00
</body>
</html>