Setting Default Slider Value – jQuery UI

Had a bit of a muck around with jQuery sliders today, just though I’d post the code I used to set a default value in case anyone else has a use for it:

//Create sliders
$(document).ready(function() {
   $(".slider").slider("option", "value", 100);

Just sub whatever you want your default slider value to be in place of the 100. The jQuery documentation is also pretty useful if you’re chasing any more info: jQuery Slider Documentation


Leave a Reply