Reading Progress Bar JavaScript/CSS Tutorial

preview_player
Показать описание
When site visitors scroll your blog post or web page, you can show a progress bar that slowly moves across the top of the page to show the reading progress on scroll. In this short tutorial, we’ll add a little HTML, CSS, and JavaScript to create this UX/UI.

Рекомендации по теме
Комментарии
Автор

Superfast destructuring explanation! Thanks.

TheMisieq
Автор

Thanks a lot, I didn't know it was this easy

NNNedlog
Автор

I never realized how easy this is to implement

welling
Автор

Very informational with the features available in document.Element

georgehere
Автор

Wow, this is simpler than I thought (I'm new to JS), and you made it really easy to understand. Thanks!
Any idea about how would someone use scroll events to modify a pseudo-element? For example, changing a bg color from blue to red.

RafaelHEscobar
Автор

Thanks for this tutorial! but If I want to make it smooth should I add the scroll-behaviour to smooth into the progress bar? So it will increase that bar smoothly, thanks

alfiartya
Автор

Hello, if you wanted to add this functionality to a project with Astro you would have to include the progress-bar component in the layout, right? Why didn't it work for me or maybe I'm calling the script wrong... :( Any help? Thanks

perrosanchez
Автор

Are we allowed to use this code for free? Or we must leave a link to your video in our site?
Thank you for this easy tutorial!

aymansammo