range slider style : demo 72

0
0
0

HTML

                        
0

CSS

                        .range-slider{
                            padding: 8px 55px 15px 0;
                            margin: 0 0 30px;
                            position: relative;
                        }
                        .range-slider input[type="range"]{
                            background: repeating-linear-gradient(to right,transparent 0,transparent 8px,#f7f7f7 8px,#e7e7e7 16px);
                            width: 100%;
                            height: 1px;
                            outline: none;
                            -webkit-appearance: none;
                            -moz-appearance: none;
                            appearance: none;
                            position: relative;
                            z-index: 1;
                            transition: all 0.3s ease;
                        }
                        .range-slider input[type="range"]::-webkit-slider-thumb{
                            background: #87CC02;
                            width: 30px;
                            height: 30px;
                            border-radius: 50%;
                            cursor: pointer;
                            transition: all 0.15s ease-in-out 0s;
                            -webkit-appearance: none;
                            appearance: none;
                        }
                        .range-slider input[type="range"]:active::-webkit-slider-thumb,
                        .range-slider input[type="range"]::-webkit-slider-thumb:hover{
                            box-shadow: 0 0 5px rgba(0,0,0,0.5) inset,0 0 0 4px #333;
                        }
                        .range-slider input[type="range"]::-moz-range-thumb{
                            background: #87CC02;
                            width: 30px;
                            height: 30px;
                            border-radius: 50%;
                            border: none;
                            cursor: pointer;
                            transition: all 0.15s ease-in-out 0s;
                        }
                        .range-slider input[type="range"]:active::-moz-range-thumb,
                        .range-slider input[type="range"]::-moz-range-thumb:hover{
                            box-shadow: 0 0 5px rgba(0,0,0,0.5) inset,0 0 0 4px #333;
                        }
                        .range-slider .range-value{
                            color: #222;
                            background: #87CC02;
                            font-size: 18px;
                            font-weight: 600;
                            font-style: italic;
                            text-align: center;
                            width: 45px;
                            padding: 3px 0;
                            border-radius: 50%;
                            transform: translateY(50%);
                            position: absolute;
                            bottom: 50%;
                            right: 0;
                        }
                        ::-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