The code I'm using is this one
background: url(bilder/cover.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
What I'd like to accomplish is that the background image is changed after like 2 sec to a background image that then stays put.
I know there are Jqueries for changing backgrounds like this but I'm not sure how to make something like that work with the code I'm using! It would be awesome if someone hade a solution to this!
My starting point for changing background was the code I found on w3schools:
{
width:100px;
height:100px;
background:red;
animation:myfirst 5s;
-webkit-animation:myfirst 5s; /* Safari and Chrome */
}
@keyframes myfirst
{
from {background:red;}
to {background:yellow;}
}
@-webkit-keyframes myfirst /* Safari and Chrome */
{
from {background:red;}
to {background:yellow;}
}
EXAMPLE
HTML
CSS
JavaScript
Alternate Style (with FadeIn/Out effect)
HTML
CSS
JavaScript