- On certain websites, such as personal websites, we see horizontal scrolling has a simple formula that is implemented with JS. I hope you like it.
let customScroll = document.getElementById('scroll')
window.addEventListener('scroll', function () {
let scrollPercent = window.scrollY / (document.body.clientHeight - window.innerHeight)
let scrollPercentRoundede = Math.round(scrollPercent * 100)
customScroll.style.width = scrollPercentRoundede + '%'
})check this URL for visit this page
