悬停时进行3d转换会导致图像跳动和闪烁

时间:2018-11-19 08:16:51

标签: css css3 css-transitions css-transforms

对于背景图像标签和实际的<img>标签,我都遇到了这个问题-当我反复悬停时,图像会随着跳跃和闪烁而过渡。我假设新的计算可能基于其当前状态值。如何防止这种行为?

body{
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}
img {
  display: block;
  max-width: 70vw;
  max-height: 70vh;
  transition: transform .4s;
}

img:hover{
      transform: perspective(300px) scale(1.05) translateZ(-10px) rotateY(-2deg);
}
<img src="https://picsum.photos/700/600">

enter image description here

0 个答案:

没有答案