jQuery UI & Slider: Range with fixed maximum

This entry is part 3 of 11 in the series jQuery UI Slider

jQuery UI Slider – Range with fixed maximum

Fix the maximum value of the range slider so that the user can only select a minimum.

Set the range option to “max.”  

So now when you are selecting with the slide, you are selecting the minimum value.

<!doctype html>
<html lang='en'>
    <meta charset='utf-8'>
    <title>jQuery UI Slider - Range with fixed maximum</title>
    <link rel='stylesheet' href='//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css'>
    <script src='//code.jquery.com/jquery-1.10.2.js'></script>
    <script src='//code.jquery.com/ui/1.10.4/jquery-ui.js'></script>
    <link rel='stylesheet' href='https://codecrawl.com/code/jqueryui/jqueryui_style.css'>
        $(function () {
                range: 'max',
                min: 1,
                max: 10,
                value: 2,
                slide: function (event, ui) {

    <label for='amount'>Minimum number of bedrooms:</label>
    <input type='text' id='amount' style='border:0; color:#f6931f; font-weight:bold;'>

<div id='slider-range-max'></div>

Try The Code Slider Widgets API Doc
Series Navigation<< jQuery UI & Slider: Snap to increment
jQuery UI & Slider: Vertical range slider >>