HTML
<div id='accordion'>
<h5>Header 1</h5>
<ul>
<li>section 1 content visible</li>
<li>
<div id=showhide>
<textarea id=usertext>
user entered text here,scalable
</textarea>
</div>
</li>
</ul>
<h5>Header 2</h5>
<ul>
<li>section 2 content 1</li>
<li>section 2 content X</li>
</ul>
</div>
#showhide
can be either visible or hidden (to save space)
How to get dimensions of #usertext
regardless of which section of accordion is expanded and whether #showhide
is visible or collapsed?
jquery's .width()
does not return value for hidden elements. I could potentially set display:block
but there are a lot of elements on the page and I send dimensions in async
JS post, I cannot coordinate the timing of showing elements and getting its dimensions. I don't want to go to sync
since page will freeze for a long time.
Any suggestions?