Skip to content

Instantly share code, notes, and snippets.

@colewinans
Created December 28, 2012 04:18
Show Gist options
  • Save colewinans/4394433 to your computer and use it in GitHub Desktop.
Save colewinans/4394433 to your computer and use it in GitHub Desktop.
Synchronized scrolling between two divs
$(document).ready(function(){
var topdivPos = $(".table-top").position();
$(".table-bottom").css("position","absolute").css("top",topdivPos.top).css("left",topdivPos.left).show();
$(".table-top").scroll(function(){
$(".table-bottom").scrollTop($(".table-top").scrollTop());
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment