2

I'm using the example provided in: http://jsfiddle.net/9R4hZ/40/

to have divs scrolling with mouse wheel. It works fine, but I would like to move 2 divs at the same time, instead of moving them one by one.

Is it feasible?

Kyle Macey
  • 8,074
  • 2
  • 38
  • 78

1 Answers1

0

To update the scroll position of div A when div B gets scrolled, listen for the onscroll event and update the scroll position of the other div.

$('#a').scroll(function(){
    $('#b').scrollTop($(this).scrollTop());
});
Ruan Mendes
  • 90,375
  • 31
  • 153
  • 217