title: Jquery if (is visible) / else
body: <p>Here's my situation : First when load the page I Hide menus "menu(2a,3a,4a,5a,6a)" exept "menu1a" that i hide "menu1b". Then I want to click in a button that have that check if "menu1a" is visible or not and run a condition, so when I click in him again the if condition shouldn't happen becouse in the button should hide it.</p>
  
  <p>Here's the Html :</p>
  
  <pre><code>        &lt;div class="main"&gt;
              &lt;div class="menu" id="menu1a"&gt;&lt;/div&gt;
              &lt;div class="menu" id="menu1b"&gt;&lt;/div&gt;
              &lt;div class="menu" id="menu2a"&gt;&lt;/div&gt;
              &lt;div class="menu" id="menu2b"&gt;&lt;/div&gt;
              &lt;div class="menu" id="menu3a"&gt;&lt;/div&gt;
              &lt;div class="menu" id="menu3b"&gt;&lt;/div&gt;
              &lt;div class="menu" id="menu4a"&gt;&lt;/div&gt;
              &lt;div class="menu" id="menu4b"&gt;&lt;/div&gt;
              &lt;div class="menu" id="menu5a"&gt;&lt;/div&gt;
              &lt;div class="menu" id="menu5b"&gt;&lt;/div&gt;
              &lt;div class="menu" id="menu6a"&gt;&lt;/div&gt;
              &lt;div class="menu" id="menu6b"&gt;&lt;/div&gt;
          &lt;/div&gt;
  </code></pre>
  
  <p>And the Script :</p>
  
  <pre><code>$(document).ready(function() {
            $('.container2').hide();
            $('.container3').hide();
            $('.container4').hide();
            $('.container5').hide();
            $('.container6').hide();
            $('#menu1b').hide();
            $('#menu2a').hide();
            $('#menu3a').hide();
            $('#menu4a').hide();
            $('#menu5a').hide();
            $('#menu6a').hide();
  });
  $('#menu2b').click(function(){
  if($('#menu1a').is(':visible'))
      {
          $('.main').delay(50).animate({marginTop : "-=160px"},{duration: 1000});
          $('.footer').delay(220).animate({marginTop : "-=150px"},{duration: 1000});
          $('.container2').animate({marginTop : "-=90px"},{duration: 0}).delay(200).show(0).slideUp(0).slideDown(150);
      }
        $('#menu1a').show();$('#menu1b').hide();
        $('#menu2a').hide();$('#menu2b').show();
        $('#menu3a').hide();$('#menu3b').show();
        $('#menu4a').hide();$('#menu4b').show();
        $('#menu5a').hide();$('#menu5b').show();
        $('#menu6a').hide();$('#menu6b').show();
  });
  </code></pre>
  
  <p>UPDATE : The if condition is beeing ignored... the menu is "margin top" every time i click on it , seems like #menu1a is visible all the time.</p>
  
  <p>Thanks in advance :)</p>