Well I ended up finding a solution by doing the following:
Wrap the content that grows with a DIV, then I detect if a (vertical) scroll bar is present by comparing the height of wrapperDiv
with the height of containerDiv
(which normally has the scroll bar if the content is too large).
If the height of wrapperDiv
is bigger than the height of containerDiv
then there is a scroll bar, if it is smaller, then there is no scroll bar.
<DIV id="containerDiv" style="width:100px;height:100px;overflow:auto;">
<DIV id="wrapperDiv">
.... content here...
</DIV>
</DIV>