如何使用以下变换来改善这种悬停动画效果:比例和原点?

时间:2019-11-07 14:08:40

标签: css css-transitions css-transforms

有人可以帮我摆脱出现在Google Chrome浏览器中的该悬停效果动画结尾的断断续续的“快照”吗?还是解释为什么会发生“快照”?

我正在寻找一种切实可行的解决方案,以使杂志封面有点像从书架上抬起一样,所以向上抬起是我想要的想法。如果将鼠标悬停在封面上,您会发现在结尾处有一点断断续续的声音,这非常刺耳。我正在努力摆脱这种情况,也了解这里发生了什么。任何帮助表示赞赏!

li.newsletter {
      text-align: center;
      width: 100%;  
}

.thumb {
	    line-height: 1px;
	    margin: 0 auto;
}      
.thumb:after{
	    content: "";
	    display: block;
	    height: 16px;
	    width: 100%;
	    background: #cbcbcb;
    	box-shadow: 10px 5px 8px 0 rgba(0,0,0,0.2);
	    width: 100%;
	    z-index: +10;
	    opacity: 0.99; // z-index stack order hack
}
img {
    	transition-duration: 0.2s;
	    transition-property: transform;
	    transition-timing-function: ease;
	    box-shadow: 4px 0px 12px 0 rgba(0, 0, 0, 0.2);
    }
a:hover img {
    	transform: scale(1.05);
    	transform-origin: 50% 100%;
    }
<ul class="newsletters">
  <li class="newsletter">
    <a href="#">
      <div class="thumb">
        <img width="100" height="200" src="https://dummyimage.com/100x200/000000/fff.jpg&text=Magazine+Cover" />           </div>
      <div class="title">
      <div class="newsletter-title">Issue No. 15</div>
      <div class="newsletter-date">September 2019</div>
     </div>
    </a>
   </li>
  </ul>

1 个答案:

答案 0 :(得分:0)

也许您应该考虑准确地告诉浏览器 您要设置动画的内容,因此不必为 all 属性设置动画。只需为此:

transition-property: transform;

代替开头的transition-property: all;,因为 all 表示 all -即使没有动画,它也会计算它们。如果可以避免计算,则过渡会更加顺畅。