Answer the question
In order to leave comments, you need to log in
How to make the background move smoothly?
People help to make a smooth movement of the background like here: pacifico-html.cmsmasters.net
Only needed for an atmospheric picture on top without sliders, etc.
I did it with css:
header {
display: block;
height: 100%;
min-height: 600px;
position: relative;
background: url(../images/top2.jpg) no-repeat center;
background-size: 100% 100%, cover;
-webkit-animation: head_slide 25s infinite;
-moz-animation: head_slide 25s infinite;
-o-animation: head_slide 25s infinite;
animation: head_slide 25s infinite;
}
@-webkit-keyframes head_slide {
0% {background-size: 100%;}
50% {background-size: 120%;}
100% {background-size: 100%;}
}
@-moz-keyframes head_slide {
0% {background-size: 100%;}
50% {background-size: 120%;}
100% {background-size: 100%;}
}
@keyframes head_slide {
0% {background-size: 100%;}
50% {background-size: 120%;}
100% {background-size: 100%;}
}
@keyframes head_slide {
0% {background-size: 100%;}
50% {background-size: 120%;}
100% {background-size: 100%;}
}
Answer the question
In order to leave comments, you need to log in
Как вариант, можно увеличивать не размер фона, а сам блок через scale: codepen.io/anon/pen/waeVGw
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question