Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dynamically set value of Bootstrap slider?

I created a slider as below,

<input id="brightness" onChange="changeBrightness()" data-slider-id='ex1Slider' type="text"
                    data-slider-min="-100" data-slider-max="100" data-slider-step="2" data-slider-value="0"/>

I need to set value dynamically to this slider. I tried,

$("#brightness").slider('setValue', 8, true);
$("#brightness").slider('refresh');

But this is not working. How can I do it?

like image 768
Nidhish Avatar asked Nov 02 '15 09:11

Nidhish


1 Answers

only $("#brightness").slider('setValue', 8, true);

refresh with initial values $("#brightness").slider('refresh');

like image 158
user3831200 Avatar answered Sep 22 '22 12:09

user3831200