By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,034 Members | 971 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,034 IT Pros & Developers. It's quick & easy.

layer moved when browser resized or resolution changed...

P: 5
Hello Everyone,

I need help to make my layers (DIV tags) in the page not moved when users change browser size or have other resolution. I got some ideas about make script that check the browser size and make this sync with the layer size, but after trying many codes and many ways to integrate that i didn't get to fix this problem.

any help with an example will be appreciated.

Thanks in advance,
Jun 13 '07 #1
Share this Question
Share on Google+
4 Replies


shoonya
100+
P: 161
Hello Everyone,

I need help to make my layers (DIV tags) in the page not moved when users change browser size or have other resolution. I got some ideas about make script that check the browser size and make this sync with the layer size, but after trying many codes and many ways to integrate that i didn't get to fix this problem.

any help with an example will be appreciated.

Thanks in advance,
use onresize=<function which places att things perfectly>
can u paste the piece of code here ??

shoonya
Jun 14 '07 #2

acoder
Expert Mod 15k+
P: 16,027
or you could set the position to "absolute" instead of "relative".
Jun 14 '07 #3

P: 5
thanks shoonya for your reply.

This was the code of the layer ( it was keyboard layer so i pasted here only the beginnings of the layer code, the rest is the divs of the keys of the keyboard ) and some css of the page.

Expand|Select|Wrap|Line Numbers
  1. <div onselectstart="return false" style="visibility:hidden; position:absolute; z-index:100; top:325px; left:198px; background:#fff; text-align:center; -moz-user-select:none; border:1px solid #000; width:271px; padding:1px 0 0 0;" id="keyboard" class="all_off">
  2.  
Expand|Select|Wrap|Line Numbers
  1.  
  2. body {
  3.     margin-left: 0px;
  4.     margin-top: 10px;
  5.     margin-right: 0px;
  6.     margin-bottom: 0px;
  7. }
  8.  
  9. div {
  10. position:relative;
  11. float:left;
  12. }
  13.  
  14.  
the problem was not in absolute or relative because i'm always use absolute because the layer will have a top and left style.
Jun 14 '07 #4

acoder
Expert Mod 15k+
P: 16,027
You have float set to "left" - it should be 'none'.
Jun 14 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.