range slider style : demo 3

0
0
0

HTML

                        
0

CSS

                        .demo{ background: #ea3665; }
                        .range-slider{ margin: 50px 0 0 0; }
                        .range-slider input[type="range"]{
                            width: calc(100% - (68px));
                            height: 2px;
                            border-radius:0;
                            background: #fffcf9;
                            outline: none;
                            float: left;
                            -webkit-appearance: none;
                            position: relative
                        }
                        .range-slider input[type="range"]::-webkit-slider-thumb{
                            width: 25px;
                            height: 25px;
                            background: #323b4b;
                            -webkit-clip-path: polygon(0% 15%, 20% 15%, 20% 0, 80% 0, 80% 15%, 100% 15%, 100% 85%, 80% 85%, 80% 100%, 20% 99%, 20% 85%, 0% 85%);
                            clip-path: polygon(0% 15%, 20% 15%, 20% 0, 80% 0, 80% 15%, 100% 15%, 100% 85%, 80% 85%, 80% 100%, 20% 99%, 20% 85%, 0% 85%);
                            cursor: pointer;
                            transition: background .15s ease-in-out;
                            -webkit-appearance: none;
                            appearance: none;
                        }
                        .range-slider input[type="range"]::-moz-range-thumb{
                            width: 25px;
                            height: 25px;
                            background: #323b4b;
                            border: none;
                            -webkit-clip-path: polygon(0% 15%, 20% 15%, 20% 0, 80% 0, 80% 15%, 100% 15%, 100% 85%, 80% 85%, 80% 100%, 20% 99%, 20% 85%, 0% 85%);
                            clip-path: polygon(0% 15%, 20% 15%, 20% 0, 80% 0, 80% 15%, 100% 15%, 100% 85%, 80% 85%, 80% 100%, 20% 99%, 20% 85%, 0% 85%);
                            cursor: pointer;
                            transition: background .15s ease-in-out;
                        }
                        .range-slider .range-value{
                            display: inline-block;
                            width: 60px;
                            padding: 7px 10px;
                            margin-left: 8px;
                            background: #323b4b;
                            font-size: 15px;
                            font-weight: 600;
                            color: #fff;
                            line-height: 20px;
                            text-align: center;
                            position: relative;
                            top: -15px;
                            -webkit-clip-path: polygon(0% 15%, 15% 15%, 15% 0%, 85% 0%, 85% 15%, 100% 15%, 100% 85%, 85% 85%, 85% 100%, 15% 100%, 15% 85%, 0% 85%);
                            clip-path: polygon(0% 15%, 15% 15%, 15% 0%, 85% 0%, 85% 15%, 100% 15%, 100% 85%, 85% 85%, 85% 100%, 15% 100%, 15% 85%, 0% 85%);
                        }
                        ::-moz-range-track{
                            background: #fff;
                            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