Welcome to WebmasterWorld Guest from 54.145.208.64

Forum Moderators: open

Message Too Old, No Replies

Javascript DIV, SPAN & screen resolution problems

Can anyone help me fix this?

   
9:36 pm on Aug 24, 2005 (gmt 0)

5+ Year Member



I am having a problem on my Webpage where if somebody is viewing it with a higher (or smaller) screen resolution than 800x600 it throws off the SPAN or DIV container in my script.

Anyone know what to change in the code to correct this?

[edited by: engine at 5:51 pm (utc) on Aug. 25, 2005]
[edit reason] Please post code, not urls, thanks. [/edit]

1:42 pm on Aug 27, 2005 (gmt 0)

5+ Year Member



I'd first go make sure any size properties are not fixed values. Always use percent values. Except for maybe height attributes, but definately not widths. Also make sure your "page flow" is correct and wrapping functions etc are working properly..

Hope this helps... ;)

5:59 pm on Sep 23, 2005 (gmt 0)

5+ Year Member



Thanks for the suggestion. changing to percentages solved the problem with my right hand text box but for some reason it won't work with my floater scrollbar. This is the code for the scrollbar:

<div ID="floater" style="position:absolute;z-index:1;left:750;top:130;width:11;height:260;background:#ffffff;">
<div ID="scrollbox" style="border:1px solid #000000;z-index:1;position:absolute;left:0;top:0;width:11;height:260;background:#8DA96A;" onmouseover="this.style.background='#C4DDA3';" onmouseout="this.style.background='#8DA96A';"></div>
</div>

is their a way to get this to stay in the proper place no matter what screen resolution is used to view the page?

6:00 pm on Sep 23, 2005 (gmt 0)

5+ Year Member



There is no problem with the heights, just the left & right. The higher the screen resolution (than 800x600) the green scroll bar is placed farther and farther to the left.
6:45 pm on Sep 23, 2005 (gmt 0)

5+ Year Member



I figured it out, what I did was put the entire body of the page within a new DIV container and set it to relative. Next a pair of CENTER tags around these DIV tags, adjust the postioning of the scrollbars and voila... perfectly centered with scrollbars in place no matter what screen resolution.