Search code examples
jqueryjquery-mobilejslider

jQuery mobile slider discretization and decimal digits


I am currently using jslider for my application but I am in the need of something more mobile friendly.

I am looking at the slider in jquery mobile and it looks cool and all, but I am dealing with scientific data and I need to specify arbitrary discretization (the "step" for the slider).

With jSlider I can do the following:

myElem.slider({ from: MIN, to: MAX, step: STEP, round: 2, skin: "plastic", onstatechange: function(value){sliderStateChangeHandler();}});

Where:

  • from / to specify my range
  • step specifies discretization
  • round is the number of decimal digits

Q: Can I do all of the above (in particular specify step and decimal digits) with the slider in jQuery mobile and if so can someone please provide an example?

I could not find anything other than very basic examples in the documentation.

Any help appreciated!


Solution

  • You can specify the step - see here.

    I've not seen anything to round the values to a certain number of decimal places, but you could probably handle that using events.