1

I am trying to add For steps and Value to jQuery UI Slider at This Demo to be look like this image enter image description here

so I have 4 steps and he slider handler ONLY sits on one of those values(Not Between) I already tried this methis form jQuery UI documentation

$( "#slider" ).slider({ step: 4 });
var step = $( "#slider" ).slider( "option", "step" );
$( "#slider" ).slider( "option", "step", 4 );

but it didn't work I also tried

$(function() {
    $( "#slider" ).slider({  range: "min",
    min: 1000,
    max: 7000,
    value: 1000});
  }); 

again no success! can you please let me know how I can achieve this? Thanks

1 Answer 1

2

Your step option setting should be the difference between values, not the number of steps:

$(function () {
    $("#slider").slider({
        range: "min",
        min: 1000,
        max: 7000,
        value: 1000,
        step:2000
    });
});

jsFiddle example

Sign up to request clarification or add additional context in comments.

2 Comments

Hi j08691, Thanks for reply I have to wait 10 min to accept your answer, meanwhile can you please also let me know how I can get the selected value? should I use change handler?
Look at the slide function in the fiddle. That will give you the value.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.