range slider style : demo 80

0
0
0

HTML

                        
0

CSS

                        .range-slider{
                            font-family: 'Noto Sans', sans-serif;
                            padding: 10px 0;
                            margin: 0 0 30px;
                            position: relative;
                            z-index: 1;
                        }
                        .range-slider input[type="range"]{
                            background: #273c75;
                            width: 100%;
                            height: 5px;
                            outline: none;
                            -webkit-appearance: none;
                            -moz-appearance: none;
                            appearance: none;
                            transition: all 0.3s ease;
                        }
                        .range-slider input[type="range"]::-webkit-slider-thumb{
                            background: linear-gradient(#e84118 50%, #c23616 50%);
                            width: 30px;
                            height: 30px;
                            cursor: pointer;
                            transition: all 0.15s ease-in-out 0s;
                            -webkit-appearance: none;
                            appearance: none;
                            clip-path: polygon(50% 0, 0 50%, 24% 50%, 50% 25%, 75% 50%, 50% 75%, 25% 50%, 0 50%, 50% 100%, 100% 50%);
                        }
                        .range-slider input[type="range"]:active::-webkit-slider-thumb,
                        .range-slider input[type="range"]::-webkit-slider-thumb:hover{
                            transform: rotate(90deg);
                        }
                        .range-slider input[type="range"]::-moz-range-thumb{
                            background: linear-gradient(#e84118 50%, #c23616 50%);
                            width: 30px;
                            height: 30px;
                            border-radius: 0;
                            border: none;
                            cursor: pointer;
                            transition: all 0.15s ease-in-out 0s;
                            clip-path: polygon(50% 0, 0 50%, 24% 50%, 50% 25%, 75% 50%, 50% 75%, 25% 50%, 0 50%, 50% 100%, 100% 50%);
                        }
                        .range-slider input[type="range"]:active::-moz-range-thumb,
                        .range-slider input[type="range"]::-moz-range-thumb:hover{
                            transform: rotate(90deg);
                        }
                        .range-slider .range-value{
                            color: rgba(39,60,117,0.1);
                            font-size: 45px;
                            font-weight: 600;
                            line-height: 28px;
                            text-align: center;
                            transform: translateX(-50%) translateY(50%);
                            position: absolute;
                            bottom: 50%;
                            left: 50%;
                            z-index: -1;
                        }
                        ::-moz-range-track{
                            background: transparent;
                            border: 0;
                        }
                    

JavaScript

(Range Slider depend on jQuery.)
                        
                        $(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');
                                        $(this).html(value);
                                    });
                                    range.on('input', function(){
                                        $(this).next(value).html(this.value);
                                    });
                                });
                            };
                            rangeSlider();
                        });
                    
License Terms