range slider style : demo 59

0
0
0

HTML

                        
0

CSS

                        .range-slider{
                            padding: 10px 60px 10px 7px;
                            margin: 0 0 30px;
                            border-radius: 10px;
                            position: relative;
                        }
                        .range-slider input[type="range"]{
                            background: #292929;
                            width: 100%;
                            height: 10px;
                            border-radius: 5px;
                            box-shadow: 0 -1px 1px #555 inset;
                            outline: none;
                            -webkit-appearance: none;
                        }
                        .range-slider input[type="range"]::-webkit-slider-thumb{
                            background: linear-gradient(to bottom,#555,#333);
                            width: 70px;
                            height: 20px;
                            border-radius: 100px;
                            box-shadow: 0 0 10px rgba(0,0,0,0.5);
                            cursor: pointer;
                            transition: all 0.15s ease-in-out 0s;
                            -webkit-appearance: none;
                            appearance: none;
                        }
                        .range-slider input[type="range"]::-webkit-slider-thumb:hover{
                            background: linear-gradient(to bottom,#555,#444);
                        }
                        .range-slider input[type="range"]:active::-webkit-slider-thumb{
                            background: linear-gradient(to bottom,#333,#555);
                        }
                        .range-slider input[type="range"]::-moz-range-thumb{
                            background: linear-gradient(to bottom,#555,#333);
                            width: 70px;
                            height: 20px;
                            border: none;
                            border-radius: 100px;
                            box-shadow: 0 0 10px rgba(0,0,0,0.5);
                            cursor: pointer;
                            transition: all 0.15s ease-in-out 0s;
                        }
                        .range-slider input[type="range"]::-moz-range-thumb:hover{
                            background: linear-gradient(to bottom,#555,#444);
                        }
                        .range-slider input[type="range"]:active::-moz-range-thumb{
                            background: linear-gradient(to bottom,#333,#555);
                        }
                        .range-slider .range-value{
                            color: #fff;
                            background: linear-gradient(to bottom,#333,#555);
                            font-size: 18px;
                            font-weight: 600;
                            text-align: center;
                            width: 45px;
                            padding: 3px;
                            border-radius: 10px;
                            transform: translateY(50%);
                            position: absolute;
                            bottom: 50%;
                            right: 6px;
                        }
                        ::-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');
                                        var max = $(this).prev().attr('max');
                                        $(this).html(value);
                                    });
                                    range.on('input', function(){
                                        $(this).next(value).html(this.value);
                                    });
                                });
                            };
                            rangeSlider();
                        });
                    
License Terms