jep
19 Dec 2011, 10:40 AM
I needed a slider with multiple thumbs, and it's going to be a while before we switch to 2.0. So I went ahead and coded it.
You can find it on github:
https://github.com/jepp/jep-Slider-for-Sencha-Touch-1.1
Attached is a screenshot.
I've tested it on an iPad and an android phone and it seems to work well. Of course, the standard slider isn't great on android in 1.1.1 so mine will be the same. It also doesn't work well in a toolbar (neither does the stock slider).
If you turn on thumb labels, you may be unhappy with how cramped they can be. Look in the css and you'll see a couple of alternate configurations. They both move the slider track away from the center so there's more room for the label. The label at the top can be a good idea for touch devices since your finger won't cover it up.
You can tweak most everything via CSS, should you so choose. I tried to avoid hardcoding anything in the javascript that would prevent that. If you want to change the track or thumbs more drastically, you'll need to override the base sencha styles like .jep-slider::after, .jep-slider .x-thumb and .jep-slider .x-thumb::before.
Since it incorporates a decent chunk of Sencha Touch code, the license is the same as it is for the rest of Sencha Touch.
Questions and suggestions are welcome. Send me a pull request on github or post patches here.
You can find it on github:
https://github.com/jepp/jep-Slider-for-Sencha-Touch-1.1
Attached is a screenshot.
I've tested it on an iPad and an android phone and it seems to work well. Of course, the standard slider isn't great on android in 1.1.1 so mine will be the same. It also doesn't work well in a toolbar (neither does the stock slider).
If you turn on thumb labels, you may be unhappy with how cramped they can be. Look in the css and you'll see a couple of alternate configurations. They both move the slider track away from the center so there's more room for the label. The label at the top can be a good idea for touch devices since your finger won't cover it up.
You can tweak most everything via CSS, should you so choose. I tried to avoid hardcoding anything in the javascript that would prevent that. If you want to change the track or thumbs more drastically, you'll need to override the base sencha styles like .jep-slider::after, .jep-slider .x-thumb and .jep-slider .x-thumb::before.
Since it incorporates a decent chunk of Sencha Touch code, the license is the same as it is for the rest of Sencha Touch.
Questions and suggestions are welcome. Send me a pull request on github or post patches here.