Closed Thread Icon

Topic awaiting preservation: getting the height of a td (Page 1 of 1) Pages that link to <a href="http://ozoneasylum.com/backlink?for=25946" title="Pages that link to Topic awaiting preservation: getting the height of a td (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: getting the height of a td <span class="small">(Page 1 of 1)</span>\

 
protoculture
Nervous Wreck (II) Inmate

From:
Insane since: Oct 2003

posted posted 06-03-2005 16:50

I've tried this... but it wont return a value unless I specify an attribute in the <TD>. I want it to dynamically grab the height, not the attribute value.

<td width="150" id="tdHeightGet">

...some code here

</td>

<script>
var daitem = document.getElementById("tdHeightGet").height;

alert(daitem);
</script>

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 06-03-2005 17:05

Check in May 2005 - 20 lines JavaScript contest - Asteroids. We discussed about that kind of problem.

var daitem = document.getElementById("tdHeightGet").offsetHeight; // should work

Hope that helps,

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 06-03-2005 18:45

Just a note. This usually has to happen after page load. So you have to fire it off of a page onload handler



.:[ Never resist a perfect moment ]:.

« BackwardsOnwards »

Show Forum Drop Down Menu