How to fadeIn & fadeOut a function?

How to fadeIn & fadeOut a function?

Hi all,

I'm 3 hours stuck on trying to find a code wich allows me to fadeIn and fadeOut in a mouseover/mouseout  function with a var in it.

I tried a lot of things adding this piece of code I got into it:

  1. $ (this).fadeIn(1000);
  2. $ (this).fadeOut(1000);

This is what I got for now:

  1. $(function() {
  2.           
  3.     $(".fade2 img")

  4.     // I want this fade in
  5.     .mouseover(function() {
  6.         var src = $(this).attr("src").match(/[^\.]+/) + "_2.gif";
  7.         $(this).attr("src", src);
  8.     })
  9.    
  10.     // I want this fade out
  11.     .mouseout(function() {
  12.         var src = $(this).attr("src").replace("_2", "");
  13.         $(this).attr("src", src);
  14.     });
  15.        
  16. });

Can anybody help me? Thank you in advanced!