[Multicolor] Gradient Range Slider Control Made in Pure JS

Multicolor-Slider is a small JavaScript library to enhance and beautify the default range slider control with custom styles and add-ons.

gradient slider javascript, gradient range slider css, range slider linear-gradient, input range background gradient, color gradient slider, range slider with ticks css

  • Display the lower and upper bands in different colors.
  • Display the current value in a tooltip just above your thumb.
  • Separate and portable code and pattern, min/max values are easily configurable.

How to make use of it:

1. Create a regular range of input on the page.

<input id="slide" type="range" min="10" max="100" value="62" oninput="displayValue(event)" />

2. Create an inline element to display the current value.

<span id="val"></span>

3. You can also create controls to change the maximum/minimum values that are allowed to be selected.

<div class="form">
  <div>
    <label for="min">Lower bound</label>
    <input type="number" id="min" onkeydown="checkPostiveInteger(event)" oninput="checkValidLimits()" placeholder="  < and != upper bound">
  </div>
  <div>
    <label for="max">Upper bound</label>
    <input type="number" id="max" onkeydown="checkPostiveInteger(event)" oninput="checkValidLimits()" placeholder="  > and != lower bound">
  </div>
  <button onclick="changeLimits()" id="limitButton" disabled>Apply limits</button>
</div>

4. Apply your own CSS styles to the slider control.

input[type=range] {
  width: 100%;
  -webkit-appearance: none;
  margin: 0;
}
input[type=range]:focus { outline: none; }
input[type=range]::-webkit-slider-runnable-track {
 width: 100%;
 height: 19px;
 cursor: pointer;
 box-shadow: 0 4px 4px rgba(0,0,0,0.3) inset;
 background: linear-gradient(to right, #005fc2, #35A834 40%, #ffd400 65%, #FF6400);
 border-radius: 20px;
 border: 0.2px solid #010101;
}
input[type=range]::-webkit-slider-thumb {
 box-shadow: 1px 1px 1px #000000, 0px 0px 1px #0d0d0d;
 border: 1px solid #000000;
 height: 20px;
 width: 20px;
 border-radius: 20px;
 background: white;
 cursor: pointer;
 -webkit-appearance: none;
 margin-top: -1px;
}
#slide:before {
  content: attr(min);
  position: absolute;
  bottom: 0;
  left: 0;
  color: black;
  font-size: 1rem;
}
#slide:after {
  content: attr(max);
  position: absolute;
  bottom: 0;
  right: 0;
  color: black;
  font-size: 1rem;
}
#val {
  font-size: 1.6rem;
  position: absolute;
  left: 0;
  bottom: 40px;
  width: 100px;
}

gradient slider control, Multicolor-Slider Plugin/Github, webkit slider runnable track, html range slider with labels


See Demo And Download

Official Website(ogostos): Click Here

This superior jQuery/javascript plugin is developed by ogostos. For extra advanced usage, please go to the official website.

Related Posts

Input-Values-Using-Mouse-Drag

Create Side Sliders Input Values Using Mouse Drag | Pointer Lock

HTML Range Slider is a lightweight library to create side sliders to adjust values easily and precisely by making use of the Pointer Lock API. Side Slider…

simple-parallax-scrolling-js

Smooth and Lightweight Parallax Scroll Library in Pure Javascript

Lightweight and seamless parallax scrolling library implemented in pure javascript using hardware acceleration for additional performance. Main Features Extremely lightweight with no dependencies A few kilobytes of pure…

Convert-Form-Data-to-JSON

How to Convert Form Data to JSON with HTML Forms | FormsJS

FormsJS is a simple-to-use JavaScript library that covers type subject values to JSON in real time. The items containing the data category will be analyzed automatically. It…

editable-html-table-using-javascript

A Small jQuery Extension to Convert An Editable HTML Table

Editable Table is a small jQuery extension to convert an editable HTML table for fast data entry and validation. A small jQuery extension to convert a static…

jquery.youtube-background

Simple jQuery Plugin for Embedding YouTube Videos As Cover Background

jquery.youtube-background is a jQuery plugin built to facilitate YouTube embeds as cover wallpaper using the YouTube Embed API. There is another jQuery Youtube Video Background plugin that…

Data-Table-Generator-Tabulator

Interactive Data Table Generator with JS/jQuery and JSON | Tabulator

Tabulator allows you to create interactive tables in seconds from any HTML Table, JavaScript array, AJAX data source, or JSON format data. Just include the library in your…