Re: [jquery-ui] Slider Range Issue

65 views
Skip to first unread message

Jörn Zaefferer

unread,
Aug 23, 2009, 11:21:21 AM8/23/09
to jque...@googlegroups.com, jquery-ui-dev
Actually determining the handle by the drag direction sounds like a
good idea. I'm not sure if its viable. I will bring this up on ui-dev
(CCed).

Jörn

On Fri, Aug 21, 2009 at 9:46 PM, greaseDonkey<grease...@gmail.com> wrote:
>
> Hi,
>
> I noticed with a slider having two handles, that when you put the max
> handle over the min handle or the other way around you can no longer
> drag the max handle toward the max value.  This can be very tricky at
> first for a site visitor who expect to drag the max value after the
> handles have been put together.
>
> Use this jquery ui exemple, and put the max handle over the min
> handle, then release and try to move the max handle again, you will
> see what I mean.
> http://jqueryui.com/demos/slider/#range
>
> I guess in the current context having both handles over each other,
> would be to complex or impossible trying to figure out witch handle
> should be dragged according to the mouse movement.   So I would
> suggest instead that the range values become equals when the handle
> are side by side and not on top of each other.
>
> Let me know what you think, or if there is a workaround.
>
> Thank you,
> Eric
>
> >
>

Richard D. Worth

unread,
Aug 23, 2009, 11:25:40 AM8/23/09
to jquery...@googlegroups.com
I've often thought this would be a really good way to go. The trickiest bit is probably that we wouldn't be able to include ui.handle in the start event if distance is 0. If you mousedown with distance 0, start triggers right away, but we since you've yet to move left or right, we don't know which handle you're dragging yet.

- Richard

Richard D. Worth

unread,
Aug 23, 2009, 11:26:47 AM8/23/09
to jquery...@googlegroups.com
Same for ui.value, as the docs read "ui.value: Integer - the current handle's value"

- Richard

Jörn Zaefferer

unread,
Aug 23, 2009, 11:33:53 AM8/23/09
to jquery...@googlegroups.com
Which makes me wonder: Where is distance:0 actually superior to
distance:1? Could we exclude that?

Jörn

Richard D. Worth

unread,
Aug 23, 2009, 11:54:35 AM8/23/09
to jquery...@googlegroups.com
We could require at least distance 1, but then we'd have to make sure that distance is only calculated based on the axis that orientation sets. So if it's a horizontal slider, only horizontal dx should influence distance, only dy for vertical. This would require a change to ui.mouse as it doesn't currently support this, just total distance from starting point.

- Richard

Jörn Zaefferer

unread,
Aug 23, 2009, 12:03:11 PM8/23/09
to jquery...@googlegroups.com
I think this ticket applies here, I've added a comment:
http://dev.jqueryui.com/ticket/3467#comment:8

Jörn
Reply all
Reply to author
Forward
0 new messages