how high is a page?

M

Merlin

Hi there,

I am wondering if there is a solution with JS to find out how high a page is.
How many pixels. Depending on how much content is on each dynamic site, I would
like to place other content on another row.

Thank you for any hint,

Merlin
 
K

kaeli

Hi there,

I am wondering if there is a solution with JS to find out how high a page is.
How many pixels. Depending on how much content is on each dynamic site, I would
like to place other content on another row.


Wow. All your users have the same screen resolution? Neat.

;)

[You should really use percents, not pixels. Good coding negates the
need to do this sort of check at all.]

--
 
J

Java script Dude

I am wondering if there is a solution with JS to find out how high a page is.
How many pixels. Depending on how much content is on each dynamic site, I would
like to place other content on another row.

There is a way to do this but it is highly innacurate. If you use
padding styles anywhere within the range you are measuring, those
padding distances are ignored. As such, you can only use margins when
working needing to get a more accurate measurement of the rendered
height or width of a DOM Elem.

To get the height of an object `o` use o.offsetHeight, for the width
use o.offsetWidth. For measuring the window size, in IE use
document.body.clientHeight & document.body.clientWidth in Moz use
window.innerHeight & window.innerWidth.

I know these properties work with IE and Moz but have not tested on
anything other browsers.

Good luck!

JsD
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top