I use css code to add a background for the whole website like this:
html {
background: url('../include-uploads/backgrounds/ironman1.jpg') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
and I want to change this automatically using jQuery code like this :
var old_url=$('html').css('background-image');
$('html').css('background-image',old_url).fadeOut(1000);
setTimeout(function(){
$('html').css({"background":"url(include-uploads/backgrounds/ironman2.jpg) no-repeat"}).fadeIn(5000);
$('html').css({"-webkit-background-size": "cover"});
$('html').css({"-moz-background-size": "cover"});
$('html').css({"-o-background-size": "cover"});
$('html').css({"background-size": "cover"});
}, 5000);
This code fading the whole website out (not just the background) and then fade the whole website in with the new background. Is there a way to fade out just the background not the whole website ?