Jquery Slider UI dynamic step size

daykkin picture daykkin · Sep 1, 2011 · Viewed 10k times · Source

I have a slider with the following properties:

  • an horizontal direction
  • one handle
  • a min of 2
  • a max of 65

My goal is to force the user to choose between only 7 points (for example: "2, 3, 4, 26, 39, 52, 65") and nothing more.

How do I create a dynamic step size or how do I allow only those points to be the slider steps?

Answer

Benoît picture Benoît · Sep 1, 2011

Why not use a slider with only 7 points, and convert your value with a table:

see my jsfiddle example http://jsfiddle.net/bouillard/Uy5sD/