However I want to make it fixed max/min span width below code :
HTML:
<div id="slider-range-max" class="custom-slider"></div>
JS:
$(function() {
$( "#slider-range-max").slider({
value:0,
min: -100,
max: 100,
step:10,
slide: function (event, ui) {
var max = $( "#slider-range-max" ).slider( "option", "max" );
if(ui.value==max){
sliderDynamicMaxVal(max,step);
}
}
}).append('<div id="blue_bar" style="width:100%"><div class="min"><span></span></div><div class="max"><span></span></div></div>');
function sliderDynamicMaxVal(MaxValue,stepValue){
// Update the global variable - do not use var keyword
var globalMaxValue =parseInt(MaxValue)+parseInt(stepValue);
console.log(MaxValue +"" +stepValue +"max"+globalMaxValue);
$( "#slider-range-max" ).slider( "option", "max", globalMaxValue);
// $( "slider-range-max" ).slider( "option", "min", 10 );
}
<div id="slider-range-max" class="custom-slider"></div>
`