HighDots Forums  

Keep Layer In Place

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Keep Layer In Place in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
mikeap
 
Posts: n/a

Default Keep Layer In Place - 11-25-2004 , 11:25 PM






How can I make a layer stay exactly in the same place no matter what the window
size is? I have a button and when you rollover I want to show a layer that
holds dynamic data from my database but I can't get the layer to always stay in
that exact spot.


Reply With Quote
  #2  
Old   
Gary White
 
Posts: n/a

Default Re: Keep Layer In Place - 11-26-2004 , 12:32 AM






"mikeap" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
How can I make a layer stay exactly in the same place no
matter what the window size is? I have a button and when you
rollover I want to show a layer that holds dynamic data from
my database but I can't get the layer to always stay in
that exact spot.

I'll bet the layer IS staying in the same exact spot. It is exactly the same
distance from the top of the page and the same distance from the left edge.
If something is moving, it's most likely some other content that is
centered. That will have to move to stay centered as the browser width
changes.

To get around that, try adding this, just above the closing </head> tag
(adjust the width as needed to hold your content):

<style type="text/css">
<!--
body{text-align:center;
#wrapper{
text-align:left;
width:760px;
top:0;
margin:0 auto;
position:relative;
}
-->
</style>

Then, right after your opening <body> tag, add this:

<div id="wrapper">

And just before your closing </body> tag, add this:

</div>

See if that doesn't help.

Gary




Reply With Quote
  #3  
Old   
mikeap
 
Posts: n/a

Default Re: Keep Layer In Place - 11-26-2004 , 01:31 AM



The site is 961 pixels wide, centered. If I set all layers to relative would that do it?

Reply With Quote
  #4  
Old   
jojo
 
Posts: n/a

Default Re: Keep Layer In Place - 11-26-2004 , 02:45 AM



mikeap wrote:
Quote:
The site is 961 pixels wide, centered. If I set all layers to
relative would that do it?
No

Gary is showing you how to create a container div that wraps around your
content. Once you have a container positioned relatively then you can
place an absolutely positioned div within that and it will take its
positioning values from its container, this will keep your absolutely
positioned divs were you want them.

Go here and read this tutorial. It isn't a complicated process but it
needs to be done right. this tut also covers the pitfalls and is a
*must* read for anyone who wants to use this technique.

http://www.communitymx.com/content/article.cfm?cid=A8BBA


--
Cheers jojo
Team Macromedia Member Volunteer for Dreamweaver MX
http://www.webade.co.uk
----------------------------------------------------
Extending Knowledge, Daily.
http://www.communityMX.com/
Free 10 day trial
http://www.communitymx.com/joincmx.cfm
----------------------------------------------------


Reply With Quote
  #5  
Old   
mikeap
 
Posts: n/a

Default Re: Keep Layer In Place - 11-26-2004 , 06:07 PM



I did what the tutorial said but I'm still not getting the desired results.
The layer still moves around depending on the window size.

body,td,th {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
text-align:center
min-width: 961px
width: 961px
}
div.wrapper {
text-align: left;
margin-left: auto;
margin-right: auto;
position:relative
}


Reply With Quote
  #6  
Old   
jojo
 
Posts: n/a

Default Re: Keep Layer In Place - 11-26-2004 , 06:12 PM



mikeap wrote:
Quote:
I did what the tutorial said but I'm still not getting the desired results.
The layer still moves around depending on the window size.

body,td,th {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
text-align:center
min-width: 961px
width: 961px
}
div.wrapper {
text-align: left;
margin-left: auto;
margin-right: auto;
position:relative
}

You are missing several closing ; after your values.

What is the url to yor page?

min-width: 961px; seems a little wide to me.

--
Cheers jojo
Team Macromedia Member Volunteer for Dreamweaver MX
http://www.webade.co.uk
----------------------------------------------------
Extending Knowledge, Daily.
http://www.communityMX.com/
Free 10 day trial
http://www.communitymx.com/joincmx.cfm
----------------------------------------------------


Reply With Quote
  #7  
Old   
mikeap
 
Posts: n/a

Default Re: Keep Layer In Place - 11-26-2004 , 06:35 PM



968 is the recommended value for 1024 resolution. So I was just guessing that
960 would fit centered. I got it working actually now, I had to change a
combination of codes (plus the adding the ;'s). I need to re-read all my
CSS-P stufff, eek - thanks for the help!


Reply With Quote
  #8  
Old   
jojo
 
Posts: n/a

Default Re: Keep Layer In Place - 11-26-2004 , 06:42 PM



mikeap wrote:
Quote:
968 is the recommended value for 1024 resolution. So I was just guessing that
960 would fit centered. I got it working actually now, I had to change a
combination of codes (plus the adding the ;'s). I need to re-read all my
CSS-P stufff, eek - thanks for the help!

Glad it's sorted.

--
Cheers jojo
Team Macromedia Member Volunteer for Dreamweaver MX
http://www.webade.co.uk
----------------------------------------------------
Extending Knowledge, Daily.
http://www.communityMX.com/
Free 10 day trial
http://www.communitymx.com/joincmx.cfm
----------------------------------------------------


Reply With Quote
  #9  
Old   
vortex242
 
Posts: n/a

Default Re: Keep Layer In Place - 11-29-2004 , 05:44 AM



I had the same problem as mikeap. I managed to solve it by adding the code
provided by Gary, but now my pop-up menus behave the same like the layers
earlier (the position of the pop-up menus changes by the resizing of the
browser's window). How can i fix this?


Reply With Quote
  #10  
Old   
Gary White
 
Posts: n/a

Default Re: Keep Layer In Place - 11-29-2004 , 09:09 AM



vortex242 wrote:

Quote:
I had the same problem as mikeap. I managed to solve it by adding the code
provided by Gary, but now my pop-up menus behave the same like the layers
earlier (the position of the pop-up menus changes by the resizing of the
browser's window). How can i fix this?

Uhhh ... change the code.

Oh, how should you change the code? Can't tell without seeing what you
have. Can you post a link?


Gary


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.