offsetHeight issues with IE vs FireFox

L

lancebryanthps

Hmm, Ive been googling and I cant seem to find a page that fixes my
problem nor does any page truely mention an issue with IE regarding
using the following code:

<code>
var contentPane = document.getElementById("myScrollContent");
alert(contentPane.offsetHeight);
</code>

The exact issue is that IE has this value at 0, and firefox has this
at 731 something pixels.

I have tried the following:

1) Tried forcing a &nbsp inside the myScrollContent Div.
2) Tried forcing a strict document standard type (i didnt' think this
one would work..)
3) Also tried forcing the display:block; display:inline; styles in the
style sheet but this also did not work...

check out http://hps.myvnc.com/alloy/index.php?page=desert..

Much appreciated for your time to read this, and if you can help
please do :D
 
L

lancebryanthps

Hmm, Ive been googling and I cant seem to find a page that fixes my
problem nor does any page truely mention an issue with IE regarding
using the following code:

<code>
var contentPane = document.getElementById("myScrollContent");
alert(contentPane.offsetHeight);
</code>

The exact issue is that IE has this value at 0, and firefox has this
at 731 something pixels.

I have tried the following:

1) Tried forcing a &nbsp inside the myScrollContent Div.
2) Tried forcing a strict document standard type (i didnt' think this
one would work..)
3) Also tried forcing the display:block; display:inline; styles in the
style sheet but this also did not work...

check outhttp://hps.myvnc.com/alloy/index.php?page=desert..

Much appreciated for your time to read this, and if you can help
please do :D

4) document.all['elementId'].offsetHeight <-- also failed.
 
D

David Mark

Hmm, Ive been googling and I cant seem to find a page that fixes my
problem nor does any page truely mention an issue with IE regarding
using the following code:

<code>
var contentPane = document.getElementById("myScrollContent");
alert(contentPane.offsetHeight);
</code>

The exact issue is that IE has this value at 0, and firefox has this
at 731 something pixels.

I have tried the following:

1) Tried forcing a &nbsp inside the myScrollContent Div.
Why?

2) Tried forcing a strict document standard type (i didnt' think this
one would work..)

You should do this anyway.
3) Also tried forcing the display:block; display:inline; styles in the
style sheet but this also did not work...

That has nothing to do with it.
check outhttp://hps.myvnc.com/alloy/index.php?page=desert..

I am pretty sure that you have to wait for the page to finish loading
before offsetHeight will return anything meaningful.
 
H

Herbert Blenner

Hmm, Ive been googling and I cant seem to find a page that fixes my
problem nor does any page truely mention an issue with IE regarding
using the following code:

<code>
var contentPane = document.getElementById("myScrollContent");
alert(contentPane.offsetHeight);
</code>

The exact issue is that IE has this value at 0, and firefox has this
at 731 something pixels.

I have tried the following:

1) Tried forcing a &nbsp inside the myScrollContent Div.
2) Tried forcing a strict document standard type (i didnt' think this
one would work..)
3) Also tried forcing the display:block; display:inline; styles in the
style sheet but this also did not work...

check outhttp://hps.myvnc.com/alloy/index.php?page=desert..

Much appreciated for your time to read this, and if you can help
please do :D

In IE 6 contentPane.offsetHeight is not available while the document
is loading. I confirmed this by placing
alert(contentPane.offsetHeight) in a function called report() that is
triggered by the onLoad event.

Good luck with changing your code.

Herbert
 
L

lancebryanthps

Hi guys,

Thanks alot that fixed the problem. Where in the heck would I google
to find information like that? I found some sites that where helping
debug that issue and it seemed that multiple people where having an
issue with the same problem.. however it seems there issues where
actually unrelated.

Thanks again!

Lance
 
L

lancebryanthps

Thanks for the help guys its fixed.. just had to put it in the onload
like you suggested.

Thanks much :D
 

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,768
Messages
2,569,575
Members
45,052
Latest member
KetoBeez

Latest Threads

Top