title: jQuery - If element has class do this
body: <p>I need an jQuery script that will see if any element has an specific class and do an action like change position.</p>
  
  <p>This is the way, but I don`t think this will work.</p>
  
  <pre><code>$("a.contact").toggle(function() {
      $("#contact").animate({
          right: '0'
      }, 2000);
  
      if ($("#about").hasClass("opened")) {
          $("#about").animate({
              right: -700 + "px"
          }, 2000);
      }
  }, function() {
      $("#contact").animate({
          right: -700 + "px"
      }, 2000);
  });
  </code></pre>