Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

189
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!