I'm using the jquery-ui slider. I would like to pass the current value of the slider to a function every time there is a change, but I'm not sure how to?
// jquery ui slider
$(function() {
$( "#slider-range-max" ).slider({
range: "max",
min: 1,
max: 100,
value: 2,
slide: function( event, ui ) {
$("#amount").val( ui.value );
}
});
$("#amount").val($("#slider-range-max").slider( "value" ) );
});
function skillLevel(){
// do something based upon slider value
};
I'm not aware of the library, but it seems, that
slide
is called each time the slider changes it's value. Within slide you are able to accessvalue
and call your own function like this:or alternatively: