Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jquery-ui slider update value from code

i've got a problem with updating slider value from code. i have tried

$('#slider').slider('value', newValue);
$('#slider').val(newValue).slider();
$('#slider').val(newValue).slider('refresh');

and no result

any other suggestions

like image 970
maxlego Avatar asked Feb 24 '23 02:02

maxlego


1 Answers

here is a sample code

Determines the value of the slider, if there's only one handle. If there is more than one handle, determines the value of the first handle.

Code examples

Initialize a slider with the value option specified.
$( ".selector" ).slider({ value: 37 });
Get or set the value option, after init.
//getter
var value = $( ".selector" ).slider( "option", "value" );
//setter
$( ".selector" ).slider( "option", "value", 37 );
like image 137
jams Avatar answered Mar 07 '23 18:03

jams