Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

136
Vistas
Why does .on("click") fire but .on("scroll") doesn't for input element?

just putting together a quick range slider and I want the "progress bar" to move based on the value of the input field changing. The main control for this will be the scroll wheel but for some reason nothing is firing when I use .on("scroll"), just trying to figure out why. It took me a while to figure out I needed the onmousewheel="" attribute present to even be able to scroll through input values.

let slideInput = $("#slider-value");

$(document).ready(function() {
    slideInput.on("click", function() {
        const value = slideInput.val();
        console.log(value);
    });
    
    slideInput.on("scroll", function() {
    const value = slideInput.val();
    console.log(value);
    });
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<input type="number" id="slider-value" onmousewheel="" step=".1" min="2" max="10" placeholder="2.0" class="slider-value">

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The event is wheel.

let slideInput = $("#slider-value");

$(document).ready(function() {
    slideInput.on("click", function() {
        const value = slideInput.val();
        console.log(value);
    });
    
    slideInput.on("wheel", function() {
    const value = slideInput.val();
    console.log(value);
    });
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<input type="number" id="slider-value" onmousewheel="" step=".1" min="2" max="10" placeholder="2.0" class="slider-value">

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda