tags:

views:

814

answers:

2

Does anyone know of some good tutorials that explain how to use the JQuery Slider.

I've found a few, but none of them really present what I need in clear terms. What I really need to figure out how to do is make the slider go from 1.0 - 5.0 (including all tenths) and when it changes set a hidden control based on that value.

Thanks.

+2  A: 

The documentation on the jQuery site is pretty good.

$('#mySlider').slider({
    min : 1,
    max : 5,
    stepping: .1,   // or, steps: 40
    change : function (e, ui) {
        $('#myHiddenInput').val(ui.value);
    }
})
nickf
Thanks, I actually just found that code a minute ago, and it seems to do what I need, but for some reason it's not passing the tenths value, just the whole number.It looks like the slide has the right number of click though. Any ideas?
Ryan Smith
you could fudge it and set min: 10, max: 50, stepping: 1, ... .val(ui.value / 10)
nickf
A: 

Hey Ryan,

I have written an article on using the jQuery UI Slider at my website, check out the link:

http://www.ryancoughlin.com/2008/11/04/using-the-jquery-ui-slider/

Thanks and let me know if you have any questions, Ryan

Coughlin