Are there any plans to support the "step" attribute for the slider control? For example, to record swimming pool water pH, I want a slider that goes from 6.0 to 9.0, with steps of 0.1.
The min and max attributes are supported, but the jquery-mobile code is using a percentage scale from 0 to 100, and ignores the "step" attribute. Also, the number in the accompanying text box only uses integers.
Query Mobile Alpha 1.0a3 added better support for the step attribute, but only for the left-side number. The slider itself still does not support the step attribute. I did come up with my own patch to fix it. I would love to see this added for the beta:
In jquery.mobile-1.0a3.js, refresh method in $.widget("mobile.slider"... at line 3697, add code to get the "step" attribute value (the first two lines below are already there):
// newval needs to support floating point min / max values, and must round to the step value var newval = (percent / 100) * (max - min) + min; newval -= (((newval - min) * 100) % (step * 100)) / 100; newval = Math.round(newval * 100 + .1) / 100;
The first line above removes the Math.round function -- I wanted to support down to 0.1 step values. The second line uses the Mod operator to strip any overage amount above the step value. The last line applies rounding, to 1 decimal position.
Good Lord...they released version 1.0rc1 and the slider "range" still has no real range capability? :-(
No step values...no decimals...no bracketing...and can't even readily display large numbers above 100.
Com-ooooonnnn!!!!! Why release v1 at all? should of just called this version b3?
A slider range that has the same capabilities in mobile as the regular 1.6.4 jquery library should be axiomatic.
This is fairly basic functionality...and like a jar of Ragu should simply be "Yeah: its in there"...but alas, this isn't a jar of spaghetti sauce is it? Oh well...have to settle for watered down ketchup...or cook my own sauce: which kinda defeats the entire point of standardized jQuery library doesn't it?
...or am I missing something???...and apologies if my post is in bad taste...as most of the jQuery Mobile is amazingly tasty...but right now, I can't serve the dinner I have been planning for months, as the range slider is the main course!