homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

Javascript DIV, SPAN & screen resolution problems
Can anyone help me fix this?

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

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)

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)

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>

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)

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)

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.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved