oops missed one line: var handlesCount = this.handles.length;
for the first part On Apr 3, 3:35 pm, jake <[email protected]> wrote: > a few changes I made to the slider.js to suit my need: > > insert after > "if(o.range == true && this.values(1) == o.min) { > closestHandle = $(this.handles[++index]);}" > > @ line 215: > else if (o.range == true && this.values(handlesCount-1) == this.values > (handlesCount-2)) { //last 2 handles overlaped > if (normValue - this.values(handlesCount-1) > 0) { //clicked to the > right of the handles > closestHandle = $(this.handles[handlesCount-1]); > index = handlesCount-1; > } > > } > > with this change, if the user click to the right of the right-most > handle and the two handles overlap, the right-most handle can be set > active and move to the right. > > also inside: _slide:function(...): > > I commented out > "if ((index == 0 && newVal >= otherVal) || (index == 1 && newVal <= > otherVal)) > newVal = otherVal; > " > and in its place, added: > "if (this.options.range==true && index == 0 && newVal > otherVal) > handle = this.handles[++index]; > else if (this.options.range==true && index == 1 && newVal < otherVal) > handle = this.handles[--index]; > " > now if you try to move handle 0 pass handle 1, it'll push handle 1 to > the right and vice versa. this best mimics a physical slider with > multiple handles > > Hope this can help people with similar concerns. > > On Apr 2, 5:05 pm, "Richard D. Worth" <[email protected]> wrote: > > > Looks like you've found a bug. It seems it depends on how many handles, and > > which handle(s). I just played around a bit with two handles and three > > handles. I'm definitely getting unexpected results. I'll dig into this. > > Thanks. > > > - Richard > > > On Thu, Apr 2, 2009 at 5:44 PM, jake <[email protected]> wrote: > > > > > > 2) when dragging the left handle towards right, it can't pass the > > > > > right handle. Can we make it a customizable option so the user can > > > > > control if this behaviour is allowed? (most of the time i think it > > > > > should be allowed for a better user experience) > > > > > This is the default behavior when range is true. Otherwise handles are > > > not > > > > related, so they can each go anywhere. You can achieve it though, by > > > > returning false in the slide event callback. Just compare ui.values[0] > > > and > > > > ui.values[1]. > > > > Thanks for replying Richard. > > > > but I set range to false and return false in the slide event handler, > > > handles still can't be dragged pass each other. any idea? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en -~----------~----~----~----~------~----~------~--~---
