Topic awaiting preservation: How to measure the height from a div? |
|
---|---|
Author | Thread |
Maniac (V) Inmate From: Den Haag: The Royal Residence |
posted 10-29-2003 22:30
No i don't mean the old "stick your ruler against your screen" method. code: <script language="JavaScript" type="text/javascript">
code: <body onLoad="getHeight('biopaul')">
|
Maniac (V) Inmate From: Den Haag: The Royal Residence |
posted 10-29-2003 23:24
After a real good search i found one working solution. Changing "getElementById(divId).height;" to "getElementById(divId).offsetHeight;" works in IE5 Moz1.4 and Opera7.01 however these browsers returned very different results. Due to the different results i guess they don't handle the offsetHeight in the same way.. |
Maniac (V) Inmate From: Brisbane, Australia |
posted 10-30-2003 18:22
Yup, you can't read the obj.height if it aint been set through script. |
Bipolar (III) Inmate From: Israel |
posted 10-30-2003 21:15
Hi, |
Maniac (V) Inmate From: Den Haag: The Royal Residence |
posted 10-31-2003 18:52
So what you are measuring is the inside from the td Not the outside from the div. |
Bipolar (III) Inmate From: schillmania.com |
posted 10-31-2003 23:27
I was recently messing around with this, you can also use a few methods to determine the "rendered" style of an element (ie. that which it inherits from CSS etc., whatever affects its properties). code: // Assuming someDiv = document.getElementById('divElementOfSomeSort'); ..
|
Maniac (V) Inmate From: Brisbane, Australia |
posted 11-01-2003 03:08
Interesting, I've never played with that kinda stuff before scott, thanks for sharing that, most helpfull. Is the moz method supported for other browsers like Opera or Kon-browsers ? |
Bipolar (III) Inmate From: Amsterdam |
posted 11-03-2003 14:01
I've been digging in my HTML past, and I found a likewise script: |
Maniac (V) Inmate From: Den Haag: The Royal Residence |
posted 11-03-2003 18:58
MMm this is intresting stuff. |
Bipolar (III) Inmate From: Amsterdam |
posted 11-05-2003 13:36
Yes it is, |
Maniac (V) Inmate From: Den Haag: The Royal Residence |
posted 11-06-2003 22:41
heheh.... |