Do the two scrollbars have the same range?

If not, you might need to calculate the relative position and apply this to the other's range.

Cheers,
_