Works like a charm :PHere is the final code if someone is interested
$(document).ready(function(){$('#item1').hover(function() { $('#bg').fadeOut('fast', function() { $("#bg").attr('src',"image1.jpg"); $("#bg").fadeIn(); } );} ); $('#item2').hover(function() { $('#bg').fadeOut('fast', function() { $("#bg").attr('src',"image2.jpg"); $("#bg").fadeIn(); } );} );$('#item3').hover(function() { $('#bg').fadeOut('fast', function() { $("#bg").attr('src',"image3.jpg"); $("#bg").fadeIn(); } );} );$('#item4').hover(function() { $('#bg').fadeOut('fast', function() { $("#bg").attr('src',"image4.jpg"); $("#bg").fadeIn(); } );} );$('#item5').hover(function() { $('#bg').fadeOut('fast', function() { $("#bg").attr('src',"image5.jpg"); $("#bg").fadeIn(); } );} );$("#item1, #item2, #item3, #item4, #item5").mouseleave(function(){ $('#bg').fadeOut('fast', function() { $("#bg").attr('src',"1.jpg"); $("#bg").fadeIn();});});});
Thank you everyone