Opened 12 years ago

Closed 11 years ago

Last modified 7 years ago

#2993 closed enhancement (wontfix)

"minRange" option for ui slider

Reported by: ksouthworth@… 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)

Change History (5)

comment:1 Changed 12 years ago by rdworth

Milestone: 1.51.5.2

comment:2 Changed 12 years ago by paul

Milestone: 1.5.2

comment:3 Changed 12 years ago by Cloudream

Milestone: TDB
Status: newassigned

comment:4 Changed 11 years ago by rdworth

Resolution: wontfix
Status: assignedclosed

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); }
});

comment:5 Changed 7 years ago by Scott González

Milestone: TBD

Milestone TBD deleted

Note: See TracTickets for help on using tickets.