Watchout4Avalanches Posted November 3, 2009 Share Posted November 3, 2009 I'm designing a web page that has boxes that you can click to make slide open and close. However, I don't know how to get the height of an element when it is defined in an external style sheet, or if it is 'auto'.The problem is that I can't get the boxes to slide back to their original size. I have to make an argument in the function, and then guess what size the box actually is. This isn't desirable because the JavaScript functions I have made will be used in many parts of this project, and eventually, many parts of the page will be dynamic.Is there a way to determine the height of an element if it has a height of 'auto', or has the height residing in an external style sheet? Link to comment Share on other sites More sharing options...
Ingolme Posted November 3, 2009 Share Posted November 3, 2009 Once you access the element, you can get its height using the offsetHeight property. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.