Hello! I ask for help, I have already broken my whole head, the minimum skill in JQ, but as soon as I didn’t excel, the thing is that I don’t manage to change the value of ui.value by clicking on an element, that is, the slider itself moves, and the value of ui. value remains the same, I ask for your attention the code:
$( ".slider-range" ).slider({ range: "min", min: 0, max: 4, value: 2, step: 1, slide: function( event, ui ) { var steps = [0, 1, 2, 3, 4]; var step; step = ui.value; if(steps.indexOf(step)===-1) return false; if(!ui.value) { document.getElementById('message').style.display = 'none'; }else{ document.getElementById('message').style.display = 'block'; } } }); $('#five').click(function(){ $(".slider-range").slider({ value: 1 }); });