Jump to content

jquery slider discrete interval


ayok

Recommended Posts

Hi,

 

I'm new with jquery and still learning how jquery works.

 

Now I'm busy with the slider. It works great. However, I'm stuck with something. I need some sliders and one of the slider has discrete values. By default the step is 1, and we can change the step. For example: $( ".selector" ).slider({ step: 5 }); So the slider will snap on values of 0, 5, 10, 15, etc. However, i need descrete value, so instead of 0, 5, 10, I need the slider snap to discrete values like 0, 1, 3, 9, 14, 49, 96 etc.

 

I cannot get any answer about this on google nor in jquery site. Is there maybe anyone who has done this?

 

Thank you in advanced.

 

Regards,

Ayok

Link to comment
https://forums.phpfreaks.com/topic/214902-jquery-slider-discrete-interval/
Share on other sites

Let me explain again.

With this code: $( ".selector" ).slider({ step: 5 }), we will achieve a slider with increment values of 5. So if we slide, the slider will snap to values of 5, 10, 15, 20 etc (multipled by 5). Instead, I want the slider snap into discrete values like 1,3,6,14,17,29, 88, 100, etc.

Oh I see what you mean, like random numbers instead of multiples? The problem with that is the plug-in has been written to use a pattern. You'd need to rewrite parts of the plug-in yourself, which definitely won't be easy if you're new to JavaScript.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.