DEV Community


Discussion on: How to make a scroll indicator bar with JS, HTML and CSS easily and explained 🖱️

robole profile image
Rob OLeary

Hi Leonardo,

I wrote about the same topic a while ago.

I chose to use <progress> rather than <div>. It is better for accessibility, but requires more effort to style.

I discussed optimization using requestAnimation and debouncing also.

I would consider doing both of these if you are putting this into a live website.

All the best