2

My client has asked me to build a ui slider using jQuery but he wants the specific values 10,20,30,50,75,100,200.

I just have a basic setup of the slider

$(function() {
  $( "#slider" ).slider({
    value:40,
    min: 10,
    max: 70,
    step: 10,
    slide: function( event, ui ) {
      $( "#amount" ).val( "$" + ui.value );
      $(this).find("a.ui-slider-handle").text(ui.value).append('<br>miles');  
    }
  });
  $( "#amount" ).val( "$" + $( "#slider" ).slider( "value" ) );
});

I just cant figure out what to do.

Thanks a lot

qiao
  • 17,941
  • 6
  • 57
  • 46
user827570
  • 491
  • 1
  • 8
  • 15
  • 1
    It's possible, see http://stackoverflow.com/questions/967372/jquery-slider-how-to-make-step-size-change and http://stackoverflow.com/questions/681303/is-there-a-plugin-or-example-of-a-jquery-slider-working-with-non-equably-divisib for code examples – Clive Jan 08 '12 at 03:56
  • 2
    Also http://stackoverflow.com/questions/857075/jquery-ui-slider-fixed-values – j08691 Jan 08 '12 at 04:06
  • Thanks but there not exactly what I'm looking for, they're all sliders with ranges for example price between $10 and $20 my slider has 1 distinct value. – user827570 Jan 08 '12 at 04:56

1 Answers1

2

I think i get what your saying, check the following fiddle http://jsfiddle.net/SpYk3/y9kbv/

SpYk3HH
  • 22,272
  • 11
  • 70
  • 81