AngularSlideables icon indicating copy to clipboard operation
AngularSlideables copied to clipboard

content.clientHeight is always 0

Open danielflippance opened this issue 10 years ago • 1 comments

I've noticed that the following line always return zero but I can't work out why:

var y = content.clientHeight;

Tried all sort of combinations of scope.$watch, setTimeout, scope.$on('$viewContentLoaded', but the contentHeight is always zero. Html is pretty straightforward:

<div slide-toggle="#headerPanel">BTN</div>
<div id="headerPanel" class="slideable">
    <div>
        <ul>
            <li><a href="/blah">Blah</a></li>
            <li><a href="/this">This</a></li>
            <li><a href="/that">That</a></li>
        </ul>
    </div>
</div>

danielflippance avatar Dec 10 '15 07:12 danielflippance

I had same problem but managed to fix it by adding overflow: hidden; in content wrapper inside 'slideable' directive. Before: element.html('<div class="slideable_content" style="margin:0 !important; padding:0 !important;" >' + contents + '</div>'); After: element.html('<div class="slideable_content" style="margin:0 !important; padding:0 !important; overflow: hidden;" >' + contents + '</div>');

h-nasu avatar Nov 15 '16 05:11 h-nasu