![]() ![]() |
Nov 3 2009, 09:28 PM
Post
#1
|
|
|
Newbie ![]() Group: Members Posts: 1 Joined: 3-September 09 Member No.: 33,555 |
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? |
|
|
|
Nov 3 2009, 09:41 PM
Post
#2
|
|
|
Duotone Fox ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 3,585 Joined: 6-November 07 Member No.: 18,212 Languages: (X)HTML, CSS, Javascript, PHP, SQL, XML [DOM]. |
Once you access the element, you can get its height using the offsetHeight property.
|
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 23rd November 2009 - 05:08 AM |