title: jQuery: Animate (fade) background-color or image in div when hover a link?
body: <p>I want to create a menu such as on redhotchilipeppers.com. When you hover a link in the top right the background color of the whole page change. The original image is still in the back, it's just the color that changes. </p>
  
  <p>Below you can see how I tried to accomplish it. It's fades way too slow and when I hover one link and then another it first fades to the first links bg color and then back to normal and then to the second links bg color. On redhotchilipeppers.com the bg colors fades right away.</p>
  
  <p>Here's the code I use right now:</p>
  
  <pre><code>&lt;head&gt;
  &lt;style&gt;
  body {
  margin:0 auto;
  top:0;
  left:0;
  height:100%;
  width:100%;
  background:url(images/bg.jpg);
  }
  
  #container {
  width:100%;
  height:100%;
  display:block;
  position:absolute;
  top:0;
  left:0;
  opacity:0.4;
  filter:alpha(opacity=40);
  -moz-opacity: 0.4;
  background-color:#fff;
  z-index:-1;
  }
  
  .link {
  position:inherit;
  z-index:1;
  float:right;
  padding-top:100px;
  }
  &lt;/style&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;div id="container"&gt;&lt;/div&gt;
  &lt;div class="link"&gt;
  &lt;a href="" id="linktomouseover"&gt;&lt;img src="images/menu_start.png" alt="" /&gt;&lt;/a&gt;&lt;a href="" id="linktomouseover2"&gt;&lt;img src="images/menu_contactus.png" alt="" /&gt;&lt;/a&gt;
  &lt;/div&gt;
  
  &lt;script&gt; 
  jQuery('#linktomouseover').hover(function() { 
  jQuery('#container').animate({ backgroundColor: "#2154b9"}, 500);
  }).mouseleave(function(){
  jQuery('#container').animate({ backgroundColor: "#ffffff"}, 500); 
  });
  
  jQuery('#linktomouseover2').hover(function() { 
  jQuery('#container').animate({ backgroundColor: "#ac1c27"}, 500);
  }).mouseleave(function(){
  jQuery('#container').animate({ backgroundColor: "#ffffff"}, 500); 
  });
  &lt;/script&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>What am I doing wrong? Or is it a better way to solve this?</p>