title: Jquery: if element is hidden, do action?
body: <p>Hello I searched a bit on the internet, but didn't find what I actualy were looking for.
  But anyway, what I'm looking for is some like if a element is hidden then it's gonna do an action, and then if the element is visible it's gonna do another action. In this case I'm building an show/hide menu, when you click the menu icon (with the class ".toggle") it's gonna change the opacity to 1, and when you hide the menu the icon opacity will change to 0.6 again.</p>
  
  <p>Here's my code anyway:</p>
  
  <pre><code>$(".sidebar_menu").hide();
  $(".sidebar li.toggle").click(function(){
  $(".sidebar_menu").animate({width: "toggle"}, 200);
  // Here's where the code I can't figure out is gonna be.
  });
  </code></pre>
  
  <p>Hope you guys wanna help me, it would be nice! Thank you.</p>