Skip to content
Permalink
Browse files

Added feedback of the current slider value next to label.

  • Loading branch information
Todd Parker
Todd Parker committed Dec 30, 2008
1 parent 25210e9 commit ee99ec9b8a897cbafcb072f9cf4b50c43739fbad
@@ -13,7 +13,7 @@
range: true,
min: 0,
max: 500,
values: [75, 300]
values: [75, 300],
});
});
</script>
@@ -13,16 +13,19 @@
range: "max",
min:1,
max:10,
value: 2
value: 2,
slide: function(event, ui) {
$("#amount").val(ui.value);
}
});
});
$("#amount").val($("#slider-range-max").slider("value")); });
</script>
</head>
<body>

<div class="demo">

<p>Minimum number of bedrooms:</p>
<p>Minimum number of bedrooms: <input type="text" id="amount" style="border:0; color:#f6931f; font-weight:bold;"/></p>
<div id="slider-range-max"></div>

</div><!-- End demo -->
@@ -35,6 +38,7 @@
<pre>
range: "max",
</pre>
<p>This demo also shows how the current slider value can be used to populate a standard form input that can also be used for user feedback.</p>

</div><!-- End demo-description -->

@@ -11,16 +11,21 @@
$(function() {
$("#slider-range-min").slider({
range: "min",
value: 37
value: 37,
min:1,
max:700,
slide: function(event, ui) {
$("#amount").val('$' + ui.value);
}
});
});
$("#amount").val('$' + $("#slider-range-min").slider("value")); });
</script>
</head>
<body>

<div class="demo">

<p>Maximum price:</p>
<p>Maximum price: <input type="text" id="amount" style="border:0; color:#f6931f; font-weight:bold;"/></p>
<div id="slider-range-min"></div>

</div><!-- End demo -->
@@ -33,6 +38,7 @@
<pre>
range: "min",
</pre>
<p>This demo also shows how the current slider value can be used to populate a standard form input that can also be used for user feedback.</p>

</div><!-- End demo-description -->

@@ -11,27 +11,35 @@
$(function() {
$("#slider-vertical").slider({
orientation: "vertical",
min: 0, max: 500, value: 140
range: "min",
min: 0,
max: 100,
value: 60,
slide: function(event, ui) {
$("#amount").val(ui.value);
}
});
});
$("#amount").val($("#slider-vertical").slider("value")); });
</script>
</head>
<body>


<div class="demo">

<p>Volume:</p>
<div id="slider-vertical" style="height:250px;"></div>
<p>Volume: <input type="text" id="amount" style="border:0; color:#f6931f; font-weight:bold;"/></p>
<div id="slider-vertical" style="height:200px;"></div>

</div><!-- End demo -->



<div class="demo-description">

<p>This is an example of a vertical slider created by setting the orientation to vertical:</p> <pre>orientation: "vertical",</pre>
<p>This is an example of a minimum range vertical slider created by setting the orientation to vertical:</p> <pre>orientation: "vertical",</pre>
<p>It's important to note that a vertical slider needs a height set. You can do this via the script options or by adding a height through CSS. </p>
<p>This demo also shows how the current slider value can be used to populate a standard form input that can also be used for user feedback.</p>


</div><!-- End demo-description -->

@@ -10,6 +10,7 @@
<script type="text/javascript">
$(function() {
$("#slider").slider({
value:100,
min: 0,
max: 500,
step: 50,
@@ -24,7 +25,7 @@

<div class="demo">

<p>Donation amount ($50 increments): <input type="text" id="amount" /></p>
<p>Donation amount ($50 increments): <input type="text" id="amount" style="border:0; color:#f6931f; font-weight:bold;"/></p>
<div id="slider"></div>

</div><!-- End demo -->
@@ -37,7 +38,7 @@
<pre>
min: 0, max: 500, step: 50
</pre>

<p>This demo also shows how the current slider value can be used to populate a standard form input that can also be used for user feedback.</p>
</div><!-- End demo-description -->

</body>

0 comments on commit ee99ec9

Please sign in to comment.
You can’t perform that action at this time.