size of frameset window

A

Andrew Poulos

I'm using this to get the size of the "inner" window

var x, y;

if (self.innerHeight) {
// all except Explorer
x = self.innerWidth;
y = self.innerHeight;
} else if (document.documentElement &&
document.documentElement.clientHeight) {
// Explorer 6 Strict Mode
x = document.documentElement.clientWidth;
y = document.documentElement.clientHeight;
} else if (document.body) {
// other Explorers
x = document.body.clientWidth;
y = document.body.clientHeight;
}

Alas, the client is putting the page within a frameset where the other
frames are so small that are "hidden". How can I modify the above code
to refer to the frameset?

Andrew Poulos
 
T

Thomas 'PointedEars' Lahn

Andrew said:
I'm using this to get the size of the "inner" window

Looks wrong.
var x, y;

It would be more consistent to use one object instead.
if (self.innerHeight) {
// all except Explorer

Most certainly not true.
x = self.innerWidth;
y = self.innerHeight;
} else if (document.documentElement &&
document.documentElement.clientHeight) {
// Explorer 6 Strict Mode

Doesn't have anything to do with the IE version.
x = document.documentElement.clientWidth;
y = document.documentElement.clientHeight;
} else if (document.body) {
// other Explorers
Pardon?

x = document.body.clientWidth;
y = document.body.clientHeight;
}

Alas, the client is putting the page within a frameset where the other
frames are so small that are "hidden". How can I modify the above code
to refer to the frameset?

Replace `self' with window.parent. Do not use `self'; use `window.self' if
you must, or simply `window'.


PointedEars
 
S

SAM

Le 7/27/09 2:57 AM, Andrew Poulos a écrit :
I'm using this to get the size of the "inner" window

var x, y;

if (self.innerHeight) {
// all except Explorer
x = self.innerWidth;
y = self.innerHeight;
} else if (document.documentElement &&
document.documentElement.clientHeight) {
// Explorer 6 Strict Mode
x = document.documentElement.clientWidth;
y = document.documentElement.clientHeight;
} else if (document.body) {
// other Explorers
x = document.body.clientWidth;
y = document.body.clientHeight;
}

Alas, the client is putting the page within a frameset where the other
frames are so small that are "hidden". How can I modify the above code
to refer to the frameset?

Andrew Poulos

from any frame, the main file (the frameset ?) is 'top'
(and not 'self')

from a frame as element of a frameset, this frameset could be 'parent'
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top