JavaScript

$("#slider-range-max").slider({range:"max",min:1,max:10,value:2,slide:function(event,ui){// we want to stop sliding if slider value became greater than 3if(ui.value>3){$("#slider-range-max").slider("option","value",3);returnfalse;}else{// $( "#amount" ) is the DOM element (i.e. a div) that show slider value $("#amount").val(ui.value);}}});