title: jQuery Animate backgroundColor with If and Else
body: <p>I'm trying to use <code>if</code> and <code>else</code> in a jQuery Function based in the <code>backgroundColor</code> of a <code>li</code> tag, for exemple: If this <code>backgroundColor = #ccc</code> do something, else, do other. I tried like this:</p>
  
  <pre><code>if ($(this).css('backgroundColor = #EBE5C5')) {
  </code></pre>
  
  <p>but it doesnt work right, can you help me?</p>
  
  <p>Hmm,thanks a lot, but it still not working right, see the full function right here:</p>
  
  <pre><code>$(function(){
  $('.slider-nav li')
      .mouseover(function(){
          if ($(this).css('background-color') == "#EBE5C5") { 
              $(this).stop().animate({'backgroundColor':'#c0ba9f'},250);
          }
      })
      .mouseout(function(){
          $(this).stop().animate({'backgroundColor':'#EBE5C5'},250);
      })
  });
  </code></pre>