How to determine page height once you've added elements?

B

blaine

Hello,

I've been fighting with trying to determing the page height after I
have added a new elements to the page with javascript (ie
body.appendChild( newNODE ) );

The following code will determin the initial page height, but doesn't
seem to work once I've added elements to the page. Is there a method
that I can use to find that page height or even when it changes? I
thought to use window.onresize, however, that does not trigger..

if (self.innerWidth)
{
frameWidth = self.innerWidth;
frameHeight = self.innerHeight;
}
else if (document.documentElement &&
document.documentElement.clientWidth)
{
frameWidth = document.documentElement.clientWidth;
frameHeight = document.documentElement.clientHeight;
}
else if (document.body)
{
frameWidth = document.body.clientWidth;
frameHeight = document.body.clientHeight;
}

Thanks,
Blaine
 

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,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top