Double dependant scroll on a div

A simple javascript to make a div scroll dependant for two different divs, one depends on the vertical scroll and the other on the horizontal scroll.
Here an example page.

      function syncScrolls()
{
        document.getElementById('header').scrollLeft = document.getElementById('data').scrollLeft;
	document.getElementById('side').scrollTop = document.getElementById('data').scrollTop;
}
Share this post:
  • Print
  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Twitter
  • Google Buzz
  • LinkedIn
  • Tumblr
Posted martedì, aprile 10th, 2012 under Web Development.

Leave a Reply