I've successfully got two divs on a page, each with a scrollbar, and using jQuery, when one div is scrolled, the other scrolls accordingly.
$('#left').scroll(function () {
$('#right').scrollTop($(this).scrollTop());
});
$('#right').scroll(function () {
$('#left').scrollTop($(this).scrollTop());
});
This works fine as along as you use the keyboard or click on the scroll bar and drag to do the scrolling, but if you use the mouse scrollwheel it's incredibly slow, due, I think, to the fact that there's a 'feedback loop'.
Is there a way I can prevent this loop so that scrolling with the mouse scrollwheel works smoothly?
Here's a fiddle showing the problem.