range slider style : demo 15

0
0
0

HTML

                        
0

CSS

                        .range-slider{ margin: 30px 0 0 0; }
                        .range-slider input[type="range"]{
                            background: rgba(0,0,0,0.2);
                            width: calc(100% - (85px));
                            height: 10px;
                            border-radius: 5px;
                            outline: none;
                            float: left;
                            -webkit-appearance: none;
                            position: relative;
                        }
                        .range-slider input[type="range"]::-webkit-slider-thumb{
                            background: linear-gradient(to right,#7b4397,#dc2430);
                            width: 24px;
                            height: 24px;
                            border: 6px solid #fff;
                            border-radius: 50%;
                            box-shadow: 0 0 5px #555;
                            cursor: pointer;
                            transition: all 0.15s ease-in-out 0s;
                            -webkit-appearance: none;
                            appearance: none;
                        }
                        .range-slider input[type="range"]::-webkit-slider-thumb:hover,
                        .range-slider input[type="range"]:active::-webkit-slider-thumb{
                            background: #fff;
                            border-color: #7b4397;
                        }
                        .range-slider input[type="range"]::-moz-range-thumb{
                            background: linear-gradient(to right,#7b4397,#dc2430);
                            width: 12px;
                            height: 12px;
                            cursor: pointer;
                            border: 6px solid #fff;
                            border-radius: 50%;
                            box-shadow: 0 0 5px #555;
                            transition: all 0.15s ease-in-out 0s;
                        }
                        .range-slider input[type="range"]::-moz-range-thumb:hover,
                        .range-slider input[type="range"]:active::-moz-range-thumb{
                            background: #fff;
                            border-color: #7b4397;
                        }
                        .range-slider .range-value{
                            color: #fff;
                            background: linear-gradient(to right,#7b4397,#dc2430);
                            font-size: 20px;
                            font-weight: 600;
                            text-align: center;
                            line-height: 35px;
                            width: 50px;
                            height: 35px;
                            margin-left: 8px;
                            border-radius: 10px;
                            display: inline-block;
                            position: relative;
                            top: -12px;
                            -webkit-clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
                            clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
                        }
                        ::-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