views:

692

answers:

1

I have a jQuery Slider, and I am trying to make it more dynamic by adding three input fields:

min

max

step

I want to take those fields and then onblur update my slider options. I read that you can set options like this:

$('.selector').slider('option', 'max', 7);

And do the same for min,step, etc along with the other options.

I tried playing with it yesterday, but I'm not sure how to get it to update. I am using a form with no submit button, so just change on blur.

I know I would get the .val() of the input and set it to a variable then would it be:

 $('.selector').slider('option', 'max', var_here);

Any thoughts?

A: 

Try using something like this, assuming that your min input has an id of 'min'

$('#min').blur(function() {
  var newMin = parseInt($(this).val());
  $('.selector').slider('option', 'min', newMin);
});
bendewey