Opened 15 years ago

Closed 15 years ago

Last modified 14 years ago

#2053 closed enhancement (fixed)

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

Reported by: jamez Owned by: eduardo
Priority: major Milestone: 1.5
Component: ui.core 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.js (10.7 KB) - added by jamez 15 years ago.
ui.slider.js mod
ui-slider-startValue.patch (2.1 KB) - added by joern 15 years ago.
startvalue as array for multiple handles patch, requires #2500 to be fixed

Download all attachments as: .zip

Change History (8)

Changed 15 years ago by jamez

Attachment: ui.slider.js added

ui.slider.js mod

comment:1 Changed 15 years ago by braeker

Owner: set to braeker

Changed 15 years ago by joern

Attachment: ui-slider-startValue.patch added

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

comment:2 Changed 15 years ago by joern

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

comment:3 Changed 15 years ago by joern

Resolution: fixed
Status: newclosed

Fixed in [4897].

comment:4 Changed 15 years ago by joern

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

comment:5 Changed 15 years ago by (none)

Milestone: 1.2.2

Milestone 1.2.2 deleted

comment:6 Changed 14 years ago by paul

Milestone: 1.5
Note: See TracTickets for help on using tickets.