I have a client who insist I force a horizontal scroll bar on their website, so I did. The problem I am having is, when viewing the website in a lower screen resolution the viewer must manually scroll to the right to center the main content on the page. I needed a script that would force the horizontal scrollbar to center and used the following…
<body onload="scrollBy((document.body['scrollWidth'] - 1010) / 2, 0)">
This does work but the page takes 15-20 sec. to initially load and if the resolution is less than 1024x768 it does not align exactly in the center.
The content area is 960px in width and is centered on the page.
I am not that well versed in Javascript and happened to stumble upon the script above. Any easier or more efficient way of achieving this?