Friday, 4 January 2019

Read scrollHeight of div with a display:none parent

With a div element in a parent div that is hidden with display:none.

  • I'm dumping the jQuery textarea element to the console. I see that the scrollHeight property of the 0th element is 88.
  • I try to read this property to a var (using $(element)[0].scrollHeight or $(element).prop('scrollHeight') and I'm getting 0.

I also tried to set the textarea to position: absolute and display: block with jQuery, before the read, with the same result.

How can I read the property correctly?



from Read scrollHeight of div with a display:none parent

No comments:

Post a Comment