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

191
Vistas
How to custom scrollbars using input type=range

Is there a way to custom a scrollbar by using input type=range?

i know there is a way to custom scrollbar by webkit scrollbar, but i also want it to work on firefox.

so far, what I have is this

https://codepen.io/sir-j/pen/NWggGde

I basically linked my $(window).scrollTop() to the value of whatever the range is.

the problem with this is that my browser can scroll up and down when i change the range, but i cannot change the input range when i scroll up and down.

anyone has any idea?

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

0

Try to use scroll event and window.scrollY to getting scroll value

P.S. This is code with two way binding, you must only synchronize that:

var i = document.querySelector('input')

i.addEventListener('input', function () {
  const num = parseNum(i.value);
  document.getElementById('thescrolling2').innerHTML =  num;
  $(window).scrollTop(num);
})

window.addEventListener('scroll', function(e) {
  i.value = parseNum(window.scrollY);
  windowScrollTop = $(window).scrollTop();
  document.getElementById('thescrolling1').innerHTML = parseNum(windowScrollTop);
}, false);

function parseNum(v) {
  return Number(v).toFixed(2);
}

scroll event

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