title: hide previous div when next div's display is none or hidden in jQuery
body: <p>Is it possible to hide a previous div when my next div's display is none or if its hidden.</p>
  
  <pre><code>&lt;div id="first"&gt; Hello &lt;/div&gt;
  &lt;div id="second"&gt;
    &lt;div id="secondchild1" style="display:none"&gt; How are you.? &lt;/div&gt;
    &lt;div id="secondchild2" style="display:none"&gt; Nice to meet you &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Now i need to hide first when all the child divs in second are hidden or thier display is none.</p>
  
  <p>And even when one of the child divs are displayed, the first should also be displayed.</p>
  
  <p>Thanks in advance.</p>