How to remove marker from excess twitching?

Good day!
Now finished work on the script(highlighting the active menu item)
All is good, but you need to realize as smooth scrolling when clicking.
All anything, Yes only when you click on say the 3rd element, we skolima to it and here came the problem.
During scrolling, when the ID of item and ID of a block is, this menu item becomes active(the active class is added), we go 2 diva and everytime the script is triggered, the result is a "floating div" skochet, but eventually comes to Celje.
Don't know how to solve this problem, here is the working script for clarity - https://codepen.io/seregindev/pen/dNOmRZ
August 19th 19 at 23:26
3 answers
August 19th 19 at 23:28
It is necessary to enter in the script the indicator animation. And ignore clicks until animation is done.
August 19th 19 at 23:30
alternatively, during the "scrolling, from js to" manipulate the class .active only when the animation completes...
I do so and implemented. But alas, here is what I have - karl.Hegmann4 commented on August 19th 19 at 23:33
August 19th 19 at 23:32

Find more questions by tags jQueryJavaScriptWeb Development