.range-slider{ padding: 20px 60px 0 0; margin: 20px 0 0 0; position: relative; } .range-slider input[type="range"]{ background: transparent; width: 100%; height: 31px; border-radius: 20px; border: 4px solid #FC427B; outline: none; -webkit-appearance: none; } .range-slider input[type="range"]::-webkit-slider-thumb{ background: #FC427B; width: 23px; height: 23px; border-radius: 50%; cursor: pointer; transition: all 0.15s ease-in-out 0s; -webkit-appearance: none; appearance: none; } .range-slider input[type="range"]::-moz-range-thumb{ background: #FC427B; width: 23px; height: 23px; border-radius: 50%; border: none; cursor: pointer; transition: all 0.15s ease-in-out 0s; } .range-slider .range-value{ color: #fff; background-color: #FC427B; font-size: 18px; font-weight: 600; text-align: center; width: 50px; padding: 5px 5px; border-radius: 40%; position: absolute; bottom: 4px; right: 0; } ::-moz-range-track{ background: transparent; border: 0; }
$(document).ready(function(){ var rangeSlider = function(){ var slider = $('.range-slider'), range = $('.range-slider input[type="range"]'), value = $('.range-value'); slider.each(function(){ value.each(function(){ var value = $(this).prev().attr('value'); var max = $(this).prev().attr('max'); $(this).html(value); }); range.on('input', function(){ $(this).next(value).html(this.value); }); }); }; rangeSlider(); });