Click to See Complete Forum and Search --> : How do I know the size/dimensions of the a frame?


John K.
11-14-2000, 01:50 PM
Lets say I have a frame with the name attribute set to "myframe".
Then suppose I view a html page named "mypage.html" inside that frame.

Now, I want to find out the size of the frame using a javascript inside
"mypage.html"
How do I do that?

The window object doesn't have any .width or .height properties,
and neither do the parent.frames["myframe"] object.

Ho do I get the size?

Garrett Smith
11-20-2000, 10:34 PM
See how this works for you.

var inWidth;
if(document.layers){
inWidth=self.innerWidth;
}else{
if(document.all){
inWidth=document.body.clientWidth;
}
}
alert(inWidth);





"John K." <john.k@home.se> wrote:
>Lets say I have a frame with the name attribute set to "myframe".
>Then suppose I view a html page named "mypage.html" inside that frame.
>
>Now, I want to find out the size of the frame using a javascript inside
>"mypage.html"
>How do I do that?
>
>The window object doesn't have any .width or .height properties,
>and neither do the parent.frames["myframe"] object.
>
>Ho do I get the size?
>
>