range slider style : demo 7

0
0
0

HTML

                        
0

CSS

                      .range-slider{ margin: 50px 0 0 0; }
                      .range-slider input[type="range"]{
                          width: calc(100% - (80px));
                          height: 20px;
                          border-radius: 30px;
                          background: linear-gradient(to bottom,#64E3F5 49%,#06C5E1 50%);
                          box-shadow: 0 0 0 5px rgba(0,0,0,0.2);
                          outline: none;
                          float: left;
                          -webkit-appearance: none;
                          position: relative;
                      }
                      .range-slider input[type="range"]::-webkit-slider-thumb{
                          width: 30px;
                          height: 30px;
                          border-radius: 5px;
                          box-shadow: 0 0 10px #000 inset,0 0 10px -3px #000;
                          background: linear-gradient(to bottom,#64E3F5 49%,#06C5E1 50%);
                          cursor: pointer;
                          transform:rotate(45deg);
                          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 10px -3px #000;}
                      .range-slider input[type="range"]::-moz-range-thumb{
                          width: 30px;
                          height: 30px;
                          border-radius: 5px;
                          box-shadow: 0 0 10px #000 inset,0 0 10px -3px #000;
                          background: linear-gradient(to bottom,#64E3F5 49%,#06C5E1 50%);
                          cursor: pointer;
                          transform:rotate(45deg);
                          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 10px -3px #000; }
                      .range-slider .range-value{
                          display: inline-block;
                          width: 63px;
                          height: 37px;
                          background: #202020;
                          border-radius: 5px 20px 20px 0;
                          margin-left: 8px;
                          font-size: 25px;
                          color: #fff;
                          line-height: 37px;
                          text-align: center;
                          position: relative;
                          top: -10px;
                      }
                      ::-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