Answers for "slider"

3

create a slider

<input className="newpost-rating-slider" type="range" name="rangeInput" 
min="0" max="5" onChange={handleSliderRating} />

<span className="slider-rating-field">0/5</span>



const handleSliderRating = () => {

        var curVal = document.querySelector('.newpost-rating-slider').value;
        var sliderRatingEle = document.querySelector('.slider-rating-field');

        sliderRatingEle.textContent =   curVal.toString() + "/5";
    
    }
Posted by: Guest on August-01-2020
2

slider

// <div id="slider"></div>
var slider = document.getElementById('slider');

noUiSlider.create(slider, {
    start: [10, 80],
    connect: true,
    range: {
        'min': 0,
        'max': 100
    }
});
Posted by: Guest on July-03-2021
2

jquery slider

// Getter
var values = $( ".selector" ).slider( "option", "values" );
 
// Setter
$( ".selector" ).slider( "option", "values", [ 10, 25 ] );
Posted by: Guest on June-14-2020

Browse Popular Code Answers by Language