---
title: "noUiSlider - limit values"  
description: "noUiSlider - limit values"  
author: "Anonymous User"  
published: 2015-02-01  
updated: 2015-02-01  
canonical: https://www.mindstick.com/forum/12928/nouislider-limit-values  
category: "javascript"  
tags: ["jquery"]  
reading_time: 1 minute  

---

# noUiSlider - limit values

I have a slider with pips from 21 to 30 with 10 markers between the numbers (like a [ruler](https://yourviews.mindstick.com/view/83478/how-muslims-ruler-encroached-on-indian-glory)) and I have a step [size](https://www.mindstick.com/forum/159799/how-can-you-manage-the-size-of-mdf-and-ldf-files) of 0.5. Is there a way to [limit](https://www.mindstick.com/forum/159824/explain-the-purpose-of-the-limit-and-offset-clauses-and-how-are-they-used-for-pagination) [values](https://www.mindstick.com/forum/327/sum-textbox-values), so the [user](https://www.mindstick.com/articles/13001/multi-statement-table-valued-user-defined-function-in-sql-server) cannot go under 21.5 but the marker starts from 21? I wouldn't [listen](https://yourviews.mindstick.com/audio/1235/mastering-in-link-building-how-listen-here) to onchange, because I want to [block](https://www.mindstick.com/forum/157599/explain-the-process-control-block-pcb-in-the-operating-system) dragging under 21.5.

Testlink: http://codepen.io/anon/pen/dPGgzK

```
$('#slider').noUiSlider({    start: 21.5,    step: 0.5,    range: {        'min': 21,        'max': 31,        '10%': 22,        '20%': 23,        '30%': 24,        '40%': 25,        '50%': 26,        '60%': 27,        '70%': 28,        '80%': 29,        '90%': 30,        '100%': 31    }}); $('#slider').noUiSlider_pips({    mode: 'range',    density: 1});
```

## Replies

### Reply by Jayden Bell

You should just be able to use the slider's slide event, for example

```
$("#slider").on({    slide: function(){        if ($("#slider").val()
< 21.5) { // if slided to somthing less than 21.5            $("#slider").val(21.5);
// set it to 21.5        }    }});
```


---

Original Source: https://www.mindstick.com/forum/12928/nouislider-limit-values

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
