-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Slider: Allow two handles on a slider-bar #2401
Conversation
+1 |
great idea. added to the feature requests page for post 1.0 https://github.com/jquery/jquery-mobile/wiki/Feature-Requests |
I don't get why jQuery Mobile isn't supporting range sliders. Will it ever be supported? |
We plan to, yes, but it's tricky to make these work when some fo our supported devices don't have touch events. You need to tap the track on these platforms so if there are two sliders, the interaction is tricky. |
Hmm, if these devices aren't supporting touch, how can the single thumb slider work? |
Two options: either enter in the value via the input or tap the track and the handle jumps to that position. To make a range work, we'd need to show both inputs and figure out which slider you meant to move if you tap the track. |
But that is what the current range slider in jQuery UI is doing. Shouldn't be that hard to copy? Isn't jQuery Mobile based on jQuery UI? |
We share the same widget factory but we have a different slider codebase right now. UI's slider doesn't work with touch at all right now so we had to go our own way. |
Why not detect touch device else fallback to input boxes/2 dropdown lists? or simply have a click/tap/touch event on the slider handle and then click/tap/touch on the bar to move that handle for example: http://jsfiddle.net/PJ7VE/1/ modified from http://jsfiddle.net/NkjQr/12/ |
I've implemented a range slider that contains 2 sliders combined. |
@jerone - That looks great! |
@uGoMobi I just did a clean up and fixed some small bugs to that repo. |
@jerone after some discussion I think we are actually going to go a little different direction with this. We are going to go with one based on this jsbin: http://jsbin.com/uzaret/514/ We really appreciate your work though! |
What happens if you want a slider there doesn't have numbers. i.e. a range of places? Just food for thought. |
@darigon - I think that is a valid use case, but it's outside the scope of the sliders currently. We only support numeric input, like a standard input with a type'="range" but using selects is a nice feature request. We built something similar as an extension to UI's slider a while back: Mind creating a new ticket for the ability to use selects for the slider and add it to the feature request wiki page here. |
I've modified the ui.slider to allow multiple handles on a slider-bar (like jquery-ui already does). This is still lacking explicit tests and i'm going to integrate the changes made for jquery/jquery-mobile/#2381 - but i'd like to get some early feedback.