Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div class="container">
  <div class="row">
    <div class="col-md-12">
      <br/>
      <h1>Rangeslider.js - range slider with diablo 3 style</h1>
    </div>
    <div class="col-md-12">
      <br/>
      <div class="slider-label">Ambient Volume</div>
      <input id="ambient-volume" class="volume-slider" type="range" min="0" max="100" step="5"/><span class="slider-value-label" id="ambient-volume-label"> 40</span>
    </div>
    <div class="col-md-12">
      <br/>
      <div class="slider-label">Effects Volume</div>
      <input id="effects-volume" class="volume-slider" type="range" min="0" max="100" step="5" value="60"/><span class="slider-value-label" id="effects-volume-label"> 60</span>
    </div>
  </div>
  
</div>
              
            
!

CSS

              
                .slider-value-label {
  color: black;
  display:inline-block;
  float:left;
  padding-left: 25px;
  font-size: 22px;
  margin-top:-7px;
}

.slider-label {
  color: #b9a078;
  margin-bottom: 10px;
}

.rangeSlider__horizontal {
  float:left;
  height: 20px;
  width: calc(100% - 65px);
  box-shadow:none;
  border:none;
  border-radius:0;
  background: none;
  border-style: solid;
  border-width: 5px 4px 5px 4px;
  -moz-border-image: url("https://raw.githubusercontent.com/cromartie1984/diablo3-project/master/SliderBar.png") 5 4 5 4 fill stretch
    repeat;
  -webkit-border-image: url("https://raw.githubusercontent.com/cromartie1984/diablo3-project/master/SliderBar.png") 5 4 5 4 fill stretch
    repeat;
  -o-border-image: url("https://raw.githubusercontent.com/cromartie1984/diablo3-project/master/SliderBar.png") 5 4 5 4 fill stretch
    repeat;
  border-image: url("https://raw.githubusercontent.com/cromartie1984/diablo3-project/master/SliderBar.png") 5 4 5 4 fill stretch repeat;
}

.rangeSlider__handle{
  width: 25px;
  height: 35px;
  top:-12px;
  border:none;
  border-radius:0;
  background: url("https://raw.githubusercontent.com/cromartie1984/diablo3-project/master/ScrollButton.png");
  background-position: left top;
  box-shadow:none;
  margin-left:-4px;
}

.rangeSlider__handle:hover{
  background-position: left center;
}

.rangeSlider__handle:active{
  background: url("https://raw.githubusercontent.com/cromartie1984/diablo3-project/master/ScrollButton.png");
  background-position: left bottom;
}

.rangeSlider__handle:focus{
  outline:none;
}

.rangeSlider__fill{
  border-radius:0;
  background: #f1793c; /* Old browsers */
  background: -moz-radial-gradient(
    center,
    ellipse cover,
    #f1793c 0%,
    #cb5e26 50%,
    #792f14 100%
  ); /* FF3.6-15 */
  background: -webkit-radial-gradient(
    center,
    ellipse cover,
    #f1793c 0%,
    #cb5e26 50%,
    #792f14 100%
  ); /* Chrome10-25,Safari5.1-6 */
  background: radial-gradient(
    ellipse at center,
    #f1793c 0%,
    #cb5e26 50%,
    #792f14 100%
  ); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
  filter: progid:DXImageTransform.Microsoft.gradient(
      startColorstr="#f1793c",
      endColorstr="#792f14",
      GradientType=1
    ); /* IE6-9 fallback on horizontal gradient */
}
              
            
!

JS

              
                var slider = document.querySelectorAll('input[type="range"]');
rangeSlider.create(slider, {
    polyfill: true,     // Boolean, if true, custom markup will be created
    rangeClass: 'rangeSlider',
    disabledClass: 'rangeSlider--disabled',
    fillClass: 'rangeSlider__fill',
    bufferClass: 'rangeSlider__buffer',
    handleClass: 'rangeSlider__handle',
    startEvent: ['mousedown', 'touchstart', 'pointerdown'],
    moveEvent: ['mousemove', 'touchmove', 'pointermove'],
    endEvent: ['mouseup', 'touchend', 'pointerup'],
    vertical: false,    // Boolean, if true slider will be displayed in vertical orientation
    /*min: 0,          
    max: 100,         
    step: 5,      */ 
    /*value: 40,*/        // Number, center of slider
    buffer: null,       // Number, in percent, 0 by default
    stick: null,        // [Number stickTo, Number stickRadius] : use it if handle should stick to stickTo-th value in stickRadius
    borderRadius: 0,   // Number, if you use buffer + border-radius in css for looks good,
    onInit: function () {
       /* console.info('onInit')*/
    },
    onSlideStart: function (position, value) {
        /*console.info('onSlideStart', 'position: ' + position, 'value: ' + value);*/
    },
    onSlide: function (position, value) {
        /*console.log('onSlide', 'position: ' + position, 'value: ' + value);*/
      $("#"+this.element.id+"-label").html(position);
    },
    onSlideEnd: function (position, value) {
        /*console.warn('onSlideEnd', 'position: ' + position, 'value: ' + value);*/
    }
});

// update position
/*var triggerEvents = true; // or false
slider.rangeSlider.update({min : 0, max : 20, step : 0.5, value : 1.5, buffer : 70}, triggerEvents);*/
              
            
!
999px

Console