Hide div if another Div is empty
Im trying to hide a div if another div is empty, but for some reason it
wont work as I want.
so basically I want to hide the <div class="more_post"> if the <div
class="last_post"> element is empty
<div id="toggle-view">
<div class="more_post">
<h5>Load more</h5>
</div>
<ul class="toggle-view">
<div class="toggle"">
<div class="last_post"> </div>
</div>
</ul>
</div>
Jquery
if($("#toggle-view ul.toggle-view .toggle .last_post").length ==0)
{
$("#toggle-view .more_post").hide();
}
No comments:
Post a Comment