]> source.dussan.org Git - jquery-ui.git/commitdiff
demos/slider/steps.html: addded a text input for feedback
authorRichard Worth <rdworth@gmail.com>
Tue, 30 Dec 2008 20:49:57 +0000 (20:49 +0000)
committerRichard Worth <rdworth@gmail.com>
Tue, 30 Dec 2008 20:49:57 +0000 (20:49 +0000)
demos/slider/steps.html

index fe516a8921647c3d606f577f6853ecaf84f61329..bc284556a9b9c04327a1d323f25cf7a746655bcf 100644 (file)
        <script type="text/javascript">
        $(function() {
                $("#slider").slider({
-                       min: 0, max: 500, step: 50
+                       min: 0,
+                       max: 500,
+                       step: 50,
+                       slide: function(event, ui) {
+                               $("#amount").val('$' + ui.value);
+                       }
                });
-       });
+               $("#amount").val('$' + $("#slider").slider("value"));   });
        </script>
 </head>
 <body>
 
 <div class="demo">
 
-<p>Donation amount ($50 increments):</p>
+<p>Donation amount ($50 increments): <input type="text" id="amount" /></p>
 <div id="slider"></div>
 
 </div><!-- End demo -->