Search and Top Navigation
#2993 closed enhancement (wontfix)
Opened June 11, 2008 11:36PM UTC
Closed March 21, 2009 05:56PM UTC
Last modified October 11, 2012 09:15PM UTC
"minRange" option for ui slider
| Reported by: | ksouthworth@gmail.com | Owned by: | paul | 
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | ui.slider | Version: | 1.5 | 
| Keywords: | Cc: | ||
| Blocked by: | Blocking: | 
Description
It'd be nice to have a "minRange" option added to the ui slider that will enforce a minimum distance between 2 handles of a slider. Like the behavior of the YUI slider here:
http://developer.yahoo.com/yui/examples/slider/slider_dual_thumb.html
API link (has the minrange option):
http://developer.yahoo.com/yui/docs/YAHOO.widget.DualSlider.html#property_minRange
I think the minRange option would be specified in terms of steps (e.g. 1 step spacing, 2 step spacing) and/or value (e.g. the 2 handles should always have a minimum range between them of X)
Attachments (0)
Change History (5)
Changed June 26, 2008 07:49PM UTC by comment:1
| milestone: | 1.5 → 1.5.2 | 
|---|
Changed July 10, 2008 08:49PM UTC by comment:2
| milestone: | 1.5.2 | 
|---|
Changed August 16, 2008 04:10PM UTC by comment:3
| milestone: | → TDB | 
|---|---|
| status: | new → assigned | 
Changed March 21, 2009 05:56PM UTC by comment:4
| resolution: | → wontfix | 
|---|---|
| status: | assigned → closed | 
This is possible (as of 1.7) by using the slide event. Returning false will prevent a slide, so you can compare the values and return false if they are too close. For example:
$("#slider").slider({
  range: true,
  values: [25, 75],
  slide: function(event, ui) { return (ui.values[1] - ui.values[0] > 5); }
});
            Changed October 11, 2012 09:15PM UTC by comment:5
| milestone: | TBD | 
|---|
Milestone TBD deleted