ayok Posted October 1, 2010 Share Posted October 1, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/214902-jquery-slider-discrete-interval/ Share on other sites More sharing options...
Adam Posted October 1, 2010 Share Posted October 1, 2010 What do you mean by "discrete" values? Quote Link to comment https://forums.phpfreaks.com/topic/214902-jquery-slider-discrete-interval/#findComment-1117979 Share on other sites More sharing options...
ayok Posted October 4, 2010 Author Share Posted October 4, 2010 Sorry, for me it's a bit difficult to explain. I mean the values has different increment. Thus, 1, 2, 5, 10, 13, 56, etc. Quote Link to comment https://forums.phpfreaks.com/topic/214902-jquery-slider-discrete-interval/#findComment-1118927 Share on other sites More sharing options...
ayok Posted October 4, 2010 Author Share Posted October 4, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/214902-jquery-slider-discrete-interval/#findComment-1118933 Share on other sites More sharing options...
Adam Posted October 4, 2010 Share Posted October 4, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/214902-jquery-slider-discrete-interval/#findComment-1118935 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.