Note that there are some explanatory texts on larger screens.

plurals
  1. POHiding parent container if children are not :visible
    primarykey
    data
    text
    <p>I'm pulling my hair out on this one...</p> <p>I'm using a jquery live search filter. Which works great. And allows me this code to attach and modify events.</p> <pre><code>// live search for items $('input#live_search').quicksearch('li.menu-item', { 'delay': 300, 'loader': 'span.loading', 'bind': 'keyup click', 'show': function () { $(this).show(); }, 'hide': function () { $(this).hide(); }, 'prepareQuery': function (val) { return new RegExp(val, "i"); }, 'testQuery': function (query, txt, _row) { return query.test(txt); } }); </code></pre> <p>The list items being filtered are each part of their own unordered list and own section. What I want to say is on keyup. If all of the list items in that particular unordered list are hidden. Hide that entire parent container...</p> <p>Ive gotten close in so many ways. But there always seems to be a snag. </p> <p>Does anyone have any ideas? </p> <p>Thanks in advance.</p> <p>The HTML renders like this:</p> <pre><code>&lt;section id="calzone" class="menu-category"&gt; &lt;header class="category-header cf"&gt;text in here&lt;/header&gt; &lt;ul class="menu-items"&gt; &lt;li class="menu-item even" style="display: list-item; "&gt; text in here &lt;/li&gt; &lt;li class="menu-item odd" style="display: none; "&gt; text in here &lt;/li&gt; &lt;li class="menu-item even" style="display: none; "&gt; text in here &lt;/li&gt; &lt;li class="menu-item odd" style="display: none; "&gt; text in here &lt;/li&gt; &lt;/ul&gt; &lt;/section&gt; &lt;section id="appetizer" class="menu-category"&gt; &lt;header class="category-header cf"&gt;text in here&lt;/header&gt; &lt;ul class="menu-items"&gt; &lt;li class="menu-item even" style="display: none;"&gt; text in here &lt;/li&gt; &lt;li class="menu-item odd" style="display: none; "&gt; text in here &lt;/li&gt; &lt;li class="menu-item even" style="display: none; "&gt; text in here &lt;/li&gt; &lt;li class="menu-item odd" style="display: none; "&gt; text in here &lt;/li&gt; &lt;/ul&gt; &lt;/section&gt; </code></pre>
    singulars
    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