If you want to use a scroll progress indicator on your page, you don’t have to mess up with JavaScript. CSS is enough. Don’t believe it? See here: