Make scroll and click events not being triggered simultaneously
I have an applications that should highlight the items of my side navbar while scrolling or clicking. The problem is that when I click on one of the sidebar headers (that navigates to it respective item on the page) it navigates by scrolling, which eventually triggers the scroll event everytime I click on something. So I found a solution of create an setTimeout event and an clickHandler flag.