Two-way scroll synchronization helper functions