Forums

This topic is locked

Centering layers

Posted 17 Oct 2003 00:13:34
1
has voted
17 Oct 2003 00:13:34 Dethel Mateo posted:
Hello,

How do I align a layer, so it will stay in the center of the browswer when it get maximize. There is no option for that in the properties....

Thanks

Replies

Replied 17 Oct 2003 02:06:16
17 Oct 2003 02:06:16 Scott Fegette replied:
If you're saying you want a css-positioned layer to always be positioned dead-center when the browser window's resized, you can't really do it w/o some trickery. Reason? Since CSS positions elements based on their relative position to the upper left corner of the window/screen, positioned layers will usually always keep their same position in relation to that corner no matter what size the window is at.

Javascript is usually the best way to get this done, but fortunately Al and Gerry over at Project VII have also made their 'Layout Designer 2' extension available for free here so you don't have to code it all yourself:

www.projectseven.com/extensions/index.htm

The 'screen' option should be just what you're after... very cool extension.

- Scott

scott fegette
macromedia, inc.
Replied 18 Oct 2003 21:59:09
18 Oct 2003 21:59:09 Dethel Mateo replied:
thanks. it is a great extension. But, how do you mke the layer center as soon as the page loads. there is no onLoad event to select on the bahavior panel. and even if I put the code manually it does not work.

Thanks for your help
Replied 22 Oct 2003 08:36:20
22 Oct 2003 08:36:20 reppert mr replied:
Hi,

Have you tried making a layer at 100%, y=0, x= whatever. Then putting a table cell inside the layer and align it center. Then putting your content in the table cell? The cell will move according to the browser window size <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

Jim
Replied 22 Oct 2003 08:37:24
22 Oct 2003 08:37:24 reppert mr replied:
Sorry, make that x=0, y=whatever...

Reply to this topic