range slider style : demo 35

0
0
0

HTML

                        
0

CSS

                        .range-slider{ margin: 30px 0 0 0; }
                        .range-slider input[type="range"]{
                            background:  #c4dd89;
                            width: calc(100% - (78px));
                            height: 20px;
                            border-radius: 3px;
                            box-shadow: inset 0 0px 2px rgba(0, 0, 0, 0.3), inset 0 2px 3px rgba(0, 0, 0, 0.2), 0 1px 0 rgba(255, 255, 255, 0.9), 0 -1px 0 rgba(0, 0, 0, 0.4);
                            outline: none;
                            float: left;
                            -webkit-appearance: none;
                            position: relative;
                        }
                        .range-slider input[type="range"]::-webkit-slider-thumb{
                            background: linear-gradient(#f9f9f9, #dedede);
                            width: 18px;
                            height: 18px;
                            border-radius: 2px;
                            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), inset 0 -1px 0 rgba(0, 0, 0, 0.1), 0 3px 4px rgba(0, 0, 0, 0.2);
                            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{
                            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), inset 0 -1px 0 rgba(0, 0, 0, 0.1), 0 3px 4px rgba(0, 0, 0, 0.5);
                        }
                        .range-slider input[type="range"]::-moz-range-thumb{
                            background: linear-gradient(#f9f9f9, #dedede);
                            width: 18px;
                            height: 18px;
                            border: none;
                            border-radius: 2px;
                            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), inset 0 -1px 0 rgba(0, 0, 0, 0.1), 0 3px 4px rgba(0, 0, 0, 0.2);
                            cursor: pointer;
                            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{
                            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), inset 0 -1px 0 rgba(0, 0, 0, 0.1), 0 3px 4px rgba(0, 0, 0, 0.5);
                        }
                        .range-slider .range-value{
                            color: #8db724;
                            background: linear-gradient(#f9f9f9, #dedede);
                            font-size: 20px;
                            font-weight: 600;
                            text-align: center;
                            text-shadow: 0 2px 0 rgba(255, 255, 255, 0.9);
                            line-height: 39px;
                            width: 65px;
                            height: 35px;
                            margin-left: 8px;
                            border-radius: 3px;
                            box-shadow: inset 0px 1px 0 white, 0px 3px 4px rgba(0, 0, 0, 0.14);
                            display: inline-block;
                            position: relative;
                            top: -11px;
                        }
                        ::-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