Skip to main content

Bug Tracker

Side navigation

#2053 closed enhancement (fixed)

Opened December 14, 2007 04:41PM UTC

Closed March 14, 2008 11:21AM UTC

Last modified March 17, 2008 05:33PM UTC

ui.slider - Multiple sliders - moveTo function with startValues.

Reported by: jamez Owned by: braeker
Priority: major Milestone: 1.2.2
Component: ui Version: 1.2.1
Keywords: Cc:
Blocked by: Blocking:
Description

I've modified ui.slider.js because I want to set the sliders to initial values and/or change the slider values via javascript.

Init example:

$('#example3').slider({ steps: 10, startValues:[0,40] });

I know this was a planned/todo function (or rather modify the moveTo function) but you may find this helpful.

Lines 86, 138-142, 295-326 contain my changes.

Thanks.

Attachments (2)
  • ui-slider-startValue.patch (2.1 KB) - added by joern March 13, 2008 02:24PM UTC.

    startvalue as array for multiple handles patch, requires #2500 to be fixed

  • ui.slider.js (10.7 KB) - added by jamez December 14, 2007 04:42PM UTC.

    ui.slider.js mod

Change History (4)

Changed March 07, 2008 02:13AM UTC by braeker comment:1

owner: → braeker

Changed March 13, 2008 02:26PM UTC by joern comment:2

I've attached a (simpler?) patch that accepts an array for startValue. It also contains the code from the #2500 patch, as that is required, too, otherwise moveTo messes up string values.

Using this enhancement, its easy to initialize multiple handles with map, if your slide represents other input fields:

$(...).slide({
  startValue: $("#x, #y").map(function() { return this.value })
});

Changed March 14, 2008 11:21AM UTC by joern comment:3

resolution: → fixed
status: newclosed

Fixed in [4897].

Changed March 17, 2008 05:33PM UTC by joern comment:4

Updated the API. To set multiple start values, use the handles-option (see docs for details).