Horje
scroll two divs simultaneously site:stackoverflow.com Code Example
scroll two divs simultaneously site:stackoverflow.com
// https://stackoverflow.com/questions/9236314/how-do-i-synchronize-the-scroll-position-of-two-divs/9236351

var isSyncingLeftScroll = false;
var isSyncingRightScroll = false;
var leftDiv = document.getElementById('left');
var rightDiv = document.getElementById('right');

leftDiv.onscroll = function() {
  if (!isSyncingLeftScroll) {
    isSyncingRightScroll = true;
    rightDiv.scrollTop = this.scrollTop;
  }
  isSyncingLeftScroll = false;
}

rightDiv.onscroll = function() {
  if (!isSyncingRightScroll) {
    isSyncingLeftScroll = true;
    leftDiv.scrollTop = this.scrollTop;
  }
  isSyncingRightScroll = false;
}




Csharp

Related
set data annotation in model c# Code Example set data annotation in model c# Code Example
reflection get enum value C# Code Example reflection get enum value C# Code Example
c# read file while writing Code Example c# read file while writing Code Example
What is the best way to lock cache in asp.net? Code Example What is the best way to lock cache in asp.net? Code Example
panning script c# on phone Code Example panning script c# on phone Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10