|
In order to center a CSS page which uses DHTML Actions
create an Action for this page by following the Recipe below:
|
When -> Page -> Page Loaded
|
|
|
click on the "Scripted Action" button and enter the following code into the Scripted Actions window:
|
var layoutWidth = XXX; if(F_NN) { var bodyWidth = window.innerWidth; var theOffset = (bodyWidth - layoutWidth)/2; if(theOffset > 0) { document.layers['LayoutLYR'].left=theOffset; } } else { var bodyWidth = document.body.offsetWidth; var theOffset = (bodyWidth - layoutWidth)/2; if(theOffset > 0) { document.all.tags('DIV') ['LayoutLYR'].style.left=theOffset; } }
|
|
where xxx is the size of the page (MasterBorder and Layout)
The effect will be that the page will load, then move into "Centering" position. If you want, you may want to "hide" the layout area, perform this Action, then show the page using Object -> Show
Heres a demo of the Scripted Action above
|