• Resolved Fabbstar

    (@fabbstar)


    Hello!

    I hope you are well?

    Do you know if there is a way of customising the values and steps of the slider using JS or a calculated field?

    Instead of 12 > 24 > 36 > 48 > 60

    I’d like to customise some of the steps as follows: 12 > 18 > 20 > 24 > 30 > 36 > 48 > 60

    So not all steps are equal?

    Many thanks,
    F

Viewing 1 replies (of 1 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @fabbstar,

    If you want change the step in the slider field programmatically, you should use a code similar to:

    
    fbuilderjQuery( ".slider" ).slider( "option", "step", 5 );
    

    Replacing the number 5 with the corresponding step to use. So, if there is inserted a calculated field in the form, you can determine the step to use in each case, and assign it to the slider programmatically.

    For example, if you want to use step = 3 if the value of the slider is 10, and step = 5 if the value is 13, and the slider field is the fieldname1, a possible equation would be:

    
    (function(){
    var v = fieldname1,step=1;
    if(v == 10) step = 3;
    if(v == 13) step = 5;
    fbuilderjQuery( ".slider" ).slider( "option", "step", step );
    })()
    

    You should use a similar logic in your project.

    Best regards.

Viewing 1 replies (of 1 total)

The topic ‘Custom Slider Values’ is closed to new replies.