jQuery à JavaScript Converter en ligne
// this worked for me
https://www.workversatile.com/jquery-to-javascript-converter/
Better Barracuda
// this worked for me
https://www.workversatile.com/jquery-to-javascript-converter/
There is no i guess:D
const rangeInput = document.querySelectorAll(".range-input input"),
priceInput = document.querySelectorAll(".price-input input"),
range = document.querySelector(".slider .progress");
let priceGap = 1000;
priceInput.forEach(input => {
input.addEventListener("input", e => {
let minPrice = parseInt(priceInput[0].value),
maxPrice = parseInt(priceInput[1].value);
if ((maxPrice - minPrice >= priceGap) && maxPrice <= rangeInput[1].max) {
if (e.target.className === "input-min") {
rangeInput[0].value = minPrice;
range.style.left = ((minPrice / rangeInput[0].max) * 100) + "%";
} else {
rangeInput[1].value = maxPrice;
range.style.right = 100 - (maxPrice / rangeInput[1].max) * 100 + "%";
}
}
});
});