title: Jquery else not executing
body: <p>I'm trying to make a responsive navigation:</p>
  
  <pre><code>       &lt;header&gt;
              &lt;nav&gt;
                  &lt;ul class="navigation"&gt;
                      &lt;li&gt;
                          &lt;a href="#"&gt;asd&lt;/a&gt;             
                      &lt;/li&gt;
                      &lt;li&gt;
                          &lt;a href="#"&gt;asd&lt;/a&gt;             
                      &lt;/li&gt;
                      &lt;li&gt;
                          &lt;a href="#"&gt;asd&lt;/a&gt;             
                      &lt;/li&gt;
                      &lt;button type="button" id="showmenu"&gt; &lt;&lt; &lt;/button&gt;
                  &lt;/ul&gt;
              &lt;/nav&gt;
          &lt;/header&gt;
  </code></pre>
  
  <p>Can't use toggle  for jquery since the button also disappers, so i tried another way, however the else statement is not executing </p>
  
  <pre><code>$(document).ready(function() {
  
              if(menu=1) {
              $('#showmenu').click(function(){
                  $('nav ul li').hide()
                  $('nav ul').css('width', '3%');
                  menu = 2;
              });
              }
              else { 
  
                  $('#showmenu').click(function() {
                  $('nav ul ').show();
                  $('nav ul').css('width', '100%');
                  menu = 1;
                  });
              }                       
          });
  </code></pre>
  
  <p>It's an inline navigation sliding to the left. I've seen a bunch of other example, but not a single one where the button hiding the menu is in the navigation. Got any suggestions on how to make this work? Used toggle before that, but the else statement still wouldnt execute. Here 's a JS fiddle: <a href="http://jsfiddle.net/qEtgR/7/" rel="nofollow">http://jsfiddle.net/qEtgR/7/</a></p>
  
  <p><strong>Edit:</strong> == operator doesn't change a thing, else statement still does not execute, neither does stating a global var menu. </p>