ScrollTo and animate problem in Google Chrome

Good evening, I have a problem with a jquery script.
As you can see from the file:
The sidebar should scroll in the table following the fall of the page.
My problem is that it doesn’t work right on Google Chrome, where, instead of scrolling down, it scroll up.
Someone could explain why or how can I fix it?
Thank you.

It’s the position() of the non-visible named anchor that’s causing the problem.

Try getting the position of the next element instead.