range slider style : demo 21

0
0
0

HTML

                        
0

CSS

                        .range-slider{ margin: 30px 0 0 0; }
                        .range-slider input[type="range"]{
                            background: linear-gradient(to bottom, #f368e0,#ce33b7);
                            width: calc(100% - (85px));
                            height: 20px;
                            border-radius: 0;
                            outline: none;
                            float: left;
                            -webkit-appearance: none;
                            position: relative;
                        }
                        .range-slider input[type="range"]::-webkit-slider-thumb{
                            background: radial-gradient(#fff,#fff,#555,#999);
                            width: 20px;
                            height: 20px;
                            border-radius: 50%;
                            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: 0 0 5px #000;
                            transform: rotateY(360deg);
                        }
                        .range-slider input[type="range"]::-moz-range-thumb{
                            background: radial-gradient(#fff,#fff,#555,#999);
                            width: 20px;
                            height: 20px;
                            cursor: pointer;
                            border: none;
                            border-radius: 50%;
                            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: 0 0 5px #000;
                            transform: rotateY(360deg);
                        }
                        .range-slider .range-value{
                            color: #fff;
                            background: #555;
                            font-size: 18px;
                            font-weight: 600;
                            text-align: center;
                            line-height: 35px;
                            width: 65px;
                            height: 35px;
                            padding: 0 5px 0 10px;
                            margin-left: 10px;
                            border-radius: 0;
                            box-shadow: inset 0 2px 6px rgba(0,0,0,0.5);
                            display: inline-block;
                            position: relative;
                            top: -8px;
                            -webkit-clip-path: polygon(75% 0%, 100% 50%, 75% 100%, 0% 100%, 25% 50%, 0% 0%);
                            clip-path: polygon(75% 0%, 100% 50%, 75% 100%, 0% 100%, 25% 50%, 0% 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