Price Range Slider jQuery UI - Download Convenient Price Range Slider With jQuery UI

Download Convenient Price Range Slider With jQuery UI

Posted on

This time I will share jQuery Plugin and tutorial about Convenient Price Range Slider With jQuery UI, hope it will help you in programming stack.

Price Range Slider jQuery UI - Download Convenient Price Range Slider With jQuery UI
File Size: 3.41 KB
Views Total: 31137
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

A simple jQuery and jQuery UI based price range slider for eCommerce websites that enable the customers to filter product list by a price range specified in the min/max value fields or by dragging the slider handlers.

How to use it:

1. Include the required jQuery and jQuery UI on the webpage.

1 <link rel="stylesheet" href="/path/to/jquery-ui.css">
2 <script src="/path/to/jquery.min.js"></script>
3 <script src="/path/to/jquery-ui.min.js"></script>

2. Include the Price Range Slider‘s JavaScript and Stylesheet on the webpage.

1 <link rel="stylesheet" href="price_range_style.css">
2 <script src="price_range_script.js"></script>

3. Create a container in which you want to render the price range slider.

1 <div id="slider-range" class="price-filter-range" name="rangeInput"></div>

4. Create min/max number inputs where the customers are able to type price values manually.

1 <input type="number" min=0 max="9900" oninput="validity.valid||(value='0');" id="min_price" class="price-range-field" />
2 <input type="number" min=0 max="10000" oninput="validity.valid||(value='10000');" id="max_price" class="price-range-field" />

5. Create a search button to filter your products by the price range specified in the number inputs.

1 <button class="price-range-search" id="price-range-submit">Search</button>

6. Create a container to display the search results.

1 <div id="searchResults" class="search-results-block"></div>

7. Customize the price range slider. You can find full slider parameters in the jQuery UI Slider page.

01 $("#slider-range").slider({
02   range: true,
03   orientation: "horizontal",
04   min: 0,
05   max: 10000,
06   values: [0, 10000],
07   step: 100,
08  
09   slide: function (event, ui) {
10     if (ui.values[0] == ui.values[1]) {
11       return false;
12     }
13      
14     $("#min_price").val(ui.values[0]);
15     $("#max_price").val(ui.values[1]);
16   }
17 });

This awesome jQuery plugin is developed by Golden-Gate. For more Advanced Usages, please check the demo page or visit the official website.

source : jquery.net