I'm trying to make the gradient fade in as the background color.
$('body').animate({
background: '-webkit-gradient(linear,left top,left bottom,from(#b0c4ff),to(#6289ff)) fixed)'
}, 2000, function(){});
http://jsfiddle.net/myLf9o0j/3/
I'm trying to make the gradient fade in as the background color.
$('body').animate({
background: '-webkit-gradient(linear,left top,left bottom,from(#b0c4ff),to(#6289ff)) fixed)'
}, 2000, function(){});
http://jsfiddle.net/myLf9o0j/3/
Make a full page div and add it on the background behind all other elements. Then you can make it animate.
Check the code below:
function goodMorning(){
$('#background').animate({
opacity: 1
}, 2000);
}
goodMorning();
body{
background-color: red;
}
#background{
opacity: 0;
position: absolute;
top: 0px;
bottom: 0px;
left: 0px;
right: 0px;
z-index: -1;
background: -webkit-gradient(linear,left top,left bottom,from(#b0c4ff),to(#6289ff)) fixed;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="background"></div>
<p>Hello :)</p>