4
<title>jQuery UI Slider - Snap to increments</title>
5
<link type="text/css" href="../../themes/base/ui.all.css" rel="stylesheet" />
6
<script type="text/javascript" src="../../jquery-1.3.2.js"></script>
7
<script type="text/javascript" src="../../ui/ui.core.js"></script>
8
<script type="text/javascript" src="../../ui/ui.slider.js"></script>
9
<link type="text/css" href="../demos.css" rel="stylesheet" />
10
<style type="text/css">
11
#demo-frame > div.demo { padding: 10px !important; };
13
<script type="text/javascript">
20
slide: function(event, ui) {
21
$("#amount").val('$' + ui.value);
24
$("#amount").val('$' + $("#slider").slider("value"));
33
<label for="amount">Donation amount ($50 increments):</label>
34
<input type="text" id="amount" style="border:0; color:#f6931f; font-weight:bold;" />
37
<div id="slider"></div>
39
</div><!-- End demo -->
41
<div class="demo-description">
43
<p>Increment slider values with the <code>step</code> option set to an integer, commonly a dividend of the slider's maximum value. The default increment is 1.</p>
45
</div><!-- End demo-description -->