Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/mongodb/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Background 如何在没有循环模式的情况下设置背景图像缩放效果的动画_Background_Zooming_Effect - Fatal编程技术网

Background 如何在没有循环模式的情况下设置背景图像缩放效果的动画

Background 如何在没有循环模式的情况下设置背景图像缩放效果的动画,background,zooming,effect,Background,Zooming,Effect,你知道如何对视差背景进行变焦吗? 与此处相同的效果: 我使用这个代码,但它不工作,而且移动版本上的图像会改变高度 div { height: 100vh; background-size: 110% 110%; background-position: center center; animation: shrink 5s infinite alternate; } @keyframes shrink { 0% { background-size: 110%

你知道如何对视差背景进行变焦吗? 与此处相同的效果:

我使用这个代码,但它不工作,而且移动版本上的图像会改变高度

    div {
  height: 100vh;
  background-size: 110% 110%;
  background-position: center center;
  animation: shrink 5s infinite alternate;
}
@keyframes shrink {
  0% {
    background-size: 110% 110%;
  }
  100% {
    background-size: 100% 100%;
  }
}