Note that there are some explanatory texts on larger screens.

plurals
  1. POHide entire list when all list items are hidden
    primarykey
    data
    text
    <p>I have a photo gallery with a nav. When you select "photos" in the nav, it hides the videos. When you click "videos," it hides the photos. </p> <p>There will be some instances where there are no videos and I want those empty rows to be hidden automatically.</p> <p>The only problem is, I'm not sure how to target <em>only</em> the empty rows.</p> <p><strong>Here is my HTML with a row that has no videos:</strong></p> <pre><code>&lt;div id="right"&gt; &lt;ul&gt; &lt;li id="gallery-all"&gt;All&lt;/li&gt; &lt;li id="gallery-photos"&gt;Photos&lt;/li&gt; &lt;li id="gallery-videos"&gt;Videos&lt;/li&gt; &lt;div class="clear"&gt;&lt;/div&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class="gallery-content" id="2012_national"&gt; &lt;ul class="row"&gt; &lt;li class="gallery-photo"&gt; &lt;a class="group" title="" rel="" href="images/IMG_0672.jpg"&gt;&lt;img src="files/photo.jpg" alt="" /&gt;&lt;/a&gt; &lt;p&gt;Caption goes here&lt;/p&gt; &lt;/li&gt; &lt;li class="gallery-photo"&gt; &lt;a class="group" title="" rel="" href="images/IMG_1474.jpg"&gt;&lt;img src="files/video.jpg" alt="" /&gt;&lt;/a&gt; &lt;p&gt;Caption goes here&lt;/p&gt; &lt;/li&gt; &lt;li class="gallery-photo"&gt; &lt;a class="group" title="" rel="" href="images/IMG_1724.jpg"&gt;&lt;img src="files/photo.jpg" alt="" /&gt;&lt;/a&gt; &lt;p&gt;Caption goes here&lt;/p&gt; &lt;/li&gt; &lt;li class="gallery-photo"&gt; &lt;a class="group" title="" rel="" href="images/IMG_1725.jpg"&gt;&lt;img src="files/video.jpg" alt="" /&gt;&lt;/a&gt; &lt;p&gt;Caption goes here&lt;/p&gt; &lt;/li&gt; &lt;div class="clear"&gt;&lt;/div&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre> <p><strong>Here is my jQuery so far:</strong></p> <pre><code>//Hide empty rows if($('.row').children(':visible').length == 0) { $('.row').hide(); }; </code></pre> <p>Any ideas?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload