title: jQuery animate if class is not .active
body: <p>I am trying to animate the background colour of my nav which I can get to work with </p>
  
  <pre><code>$(".mainNav li a").hover(function () {
      $(this).stop().animate({ backgroundColor: "#EF4D23" }, 500);
  }, function () {
      $(this).stop().animate({ backgroundColor: "#303030" }, 500);
  });
  </code></pre>
  
  <p>What i want to do next is only do this animation if the class of the  tag is not .active, so I am trying:</p>
  
  <pre><code>$(".mainNav li a").hover(function () {
      if ($(this).not(".active")) {
          (function () {
              $(this).stop().animate({ backgroundColor: "#EF4D23" }, 500);
          }, function () {
              $(this).stop().animate({ backgroundColor: "#303030" }, 500);
          });
      }
  });
  </code></pre>
  
  <p>But it is not doing anything or giving me an error.</p>
  
  <p>Thanks for any help.</p>