Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.