SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
Thread: Finding defined Div height
-
Nov 10, 2003, 14:53 #1
- Join Date
- Jan 2003
- Location
- Kansas
- Posts
- 78
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Finding defined Div height
I'm trying to detemine the height of a div in javascript. The actual height is defined in the attached stylesheet. When I query document.getElementById("ModuleHeader").style.height I get undefined. Here's a bit of the code:
Code:<div id="ModuleHeader"> <img src="photobugHEAD.jpg" width="572" height="153"></div>
Code:#ModuleHeader { width: 100%; height: 153px; position: relative; top: 0px; left: 0px; z-index: 20; text-align: left; background-color: #33CCCC; }
Code:document.getElementById('ModuleHeader').style.height;
Thanks,
Nate BaxleyNate Baxley
http://www.baxleys.org - no excusses, it is what it is.
-
Nov 10, 2003, 15:11 #2
- Join Date
- Jan 2003
- Location
- Hampshire UK
- Posts
- 40,556
- Mentioned
- 183 Post(s)
- Tagged
- 6 Thread(s)
Hi,
My javascript's skils are rubbish but I think i read that it needs to be offsetHeight.
Code:document.getElementByID('ModuleHeader').offsetHeight;
Paul
-
Nov 10, 2003, 15:14 #3
- Join Date
- Jan 2003
- Location
- Kansas
- Posts
- 78
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Paul,
Thanks for the quick reply. It was right on the money!
NateNate Baxley
http://www.baxleys.org - no excusses, it is what it is.
Bookmarks