Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
-2
rated 0 times [  4] [ 6]  / answers: 1 / hits: 24898  / 14 Years ago, mon, february 7, 2011, 12:00:00

Hello i'm trying to change the offsetHeight of an element. i used the following



document.getElementById('id').style.offsetHeight = 0;


but i saw no visible change. Can anyone help me please?


More From » html

 Answers
44

The offsetHeight property indicates the height of the visible area for an element. It's a shorthand that contains the sum of dimensions from padding, scrollbars and borders.



However, it can't be used to change the actual size and as noted in comments, offsetHeight is a property of an element, not style.



To modify the actual size use height, padding or border.


[#93852] Saturday, February 5, 2011, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
hallie

Total Points: 503
Total Questions: 114
Total Answers: 103

Location: Iraq
Member since Fri, Jun 5, 2020
4 Years ago
;