I'm using the following Javascript to position layers offset from the center of the screen, so that they all are always is the same position relative to each other, with the overall layout centered whatever the screen size. (This is just the IE script, I'll get on to other browsers afterwards)
function middle() {
var width;
if (document.all) {
width = document.body.offsetWidth;
document.all('Background').style.width = width - 20;
document.all('BigLogo').style.posLeft = (width / 2) - 400 + 27;
document.all('MainMenu').style.posLeft = (width / 2) - 400;
document.all('Content').style.posLeft = (width / 2) - 400 + 75;
document.all('URLphone').style.posLeft = (width / 2) - 400 + 464;
document.all('BigImage').style.posLeft = (width / 2) - 400 + 558;
if (document.all('SubMenuFrame')) {document.all('SubMenuFrame').style.width = width - 20;}
document.all('BottomFrame').style.width = width - 20;
document.all('ASGhome').style.posLeft = (width / 2) - 400;
document.all('SykesHome').style.posLeft = (width / 2) - 400 + 657;
}
}
The problem is that the page first loads left-aligned before the screen dimensions are measured, then the whole lot is moved to the middle. This happens every time a page is loaded for the first time. You can see it here
Is there any way to have the layers appear in the correct position so there's no movement on the page?
Cheers
Dorian
|