Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic sizing of Frames (with Javascript?)

Status
Not open for further replies.

Safacto

Programmer
Feb 10, 2002
15
0
0
GB
Hi,

My website needs to fuction on both 800x600 and 1024x768 res screens. I know this is similar to the post below, but it's significantly different.

I have sorted all the widths out with absolute sizes so they fit right. However, the height of the main <DIV> is causing problems.

Currently it is set to 72% which works, however higher res screens give more white space. Is there a way to size frames or <DIV> with javascript, much as you can to size a window.

i.e. var h = screen.availheight - 200
<DIV Style=&quot;height:h&quot;>

Cheers,
Richard.
 
I don't know about <div>, but we use this to change our frame height's parent.document.body.rows='94%,0%,0%,2%,3%,1%';
 
Hiya,

Just thought I'd let you know I just figured it out. Obvious really, just use this function:

<script language=&quot;javascript&quot;>
function changeheight(divid) {
document.all[divid].style.height=screen.availheight-200;
}
</script>

Simple really.

Richard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top