Hi there,
I'm just exploring the use of the jquery slider and am keen to make use of the "disabled" functionality. Basically what I want is if a boolean checkbox is unticked (true) then the slider is disabled and enabled when the checkbox is ticked.
- <script>
- $(function() {
- $( "#slider-range" ).slider({
- range: true,
- min: 0,
- max: 500,
- values: [ 75, 300 ],
- slide: function( event, ui ) {
- $( "#amount" ).val( "$" + ui.values[ 0 ] + " - $" + ui.values[ 1 ] );
- }
- });
- $( "#amount" ).val( "$" + $( "#slider-range" ).slider( "values", 0 ) +
- " - $" + $( "#slider-range" ).slider( "values", 1 ) );
- $( "#active" ).slider( "option", "disabled" );
- });
- </script>
- <p>
- <input type="checkbox" id= "active" name="active" />
- <label for="amount">Price range:</label>
- <input type="text" id="amount" style="border:0; color:#f6931f; font-weight:bold;" />
- </p>
- <div id="slider-range"></div>
I'm also keen to set the maximum and minimum values using a textbox but I think that the logic will be the same as the disable bit using:
- $( ".selector" ).slider( "option", "max", 7 );
Any clues or tips would be hugely appreciated,
Aaron