range slider style : demo 24

0
0
0

HTML

                        
0

CSS

                        .range-slider{ margin: 20px 0 0 0; }
                        .range-slider input[type="range"]{
                            background: linear-gradient(to bottom,#777,transparent,#777);
                            width: calc(100% - (85px));
                            height: 10px;
                            border-radius: 7px;
                            outline: none;
                            float: left;
                            -webkit-appearance: none;
                            position: relative;
                        }
                        .range-slider input[type="range"]::-webkit-slider-thumb{
                            background: #1d97f4;
                            width: 30px;
                            height: 30px;
                            border-radius: 50%;
                            cursor: pointer;
                            -webkit-clip-path: polygon(0 0, 50% 60%, 100% 0);
                            clip-path: polygon(0 0, 50% 60%, 100% 0);
                            transition: all 0.15s ease-in-out 0s;
                            -webkit-appearance: none;
                            appearance: none;
                        }
                        .range-slider input[type="range"]::-moz-range-thumb{
                            background: #1d97f4;
                            width: 30px;
                            height: 30px;
                            border-radius: 50%;
                            cursor: pointer;
                            border: none;
                            -webkit-clip-path: polygon(0 0, 50% 60%, 100% 0);
                            clip-path: polygon(0 0, 50% 60%, 100% 0);
                            transition: all 0.15s ease-in-out 0s;
                        }
                        .range-slider .range-value{
                            color: #333;
                            background: #fff;
                            font-size: 20px;
                            font-weight: 600;
                            text-align: center;
                            line-height: 33px;
                            width: 50px;
                            height: 40px;
                            margin-left: 10px;
                            border: 4px solid #1d97f4;
                            display: inline-block;
                            position: relative;
                            top: -15px;
                        }
                        ::-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