gpt4 book ai didi

html - 边缘浏览器 : Jerking movement at the end of transition only when skew and translate are used together

转载 作者:可可西里 更新时间:2023-11-01 14:59:04 26 4
gpt4 key购买 nike

我的定位标签后面有一个 position:absolute 元素。当 anchor 标记悬停时,我使用简单的 css 转换为该元素设置动画。

仅在 Edge 上,在过渡的最后会有这种时髦的抖动。

我尝试将 translateX(0) 添加到悬停和正常状态,但这并没有消除最后的抖动。

这是按钮 html:

.button {
display: inline-block;
border: none;
background: transparent;
position: relative;
color: #212121;
font-size: 19px;
line-height: 1;
padding: 0;
margin: 30px;
text-decoration: none;
font-weight: 400;
cursor: pointer;
z-index: 2;
transition: .3s;
transition-timing-function: cubic-bezier(.82, .21, .27, .81);
}

.button-bg {
position: absolute;
padding: 30px;
height: 50px;
border-radius: 0;
left: -30px;
right: -30px;
top: 50%;
transform: translateY(-50%);
z-index: -1;
transition: .4s;
transition-timing-function: cubic-bezier(.82, .21, .27, .81);
transform-origin: center;
border: 2px solid #212121;
}

a.button:hover .button-bg {
-webkit-transform: translateY(-50%) scaleY(2) scaleX(1.4) skewY(10deg);
transform: translateY(-50%) scaleY(2) scaleX(1.4) skewY(10deg);
-webkit-transform-origin: center;
transform-origin: center;
border: 2px solid transparent;
-webkit-box-shadow: 0px 0px 20px 0px rgba(48, 48, 48, 0.6);
-moz-box-shadow: 0px 0px 20px 0px rgba(48, 48, 48, 0.6);
box-shadow: 0px 0px 20px 0px rgba(48, 48, 48, 0.6);
}
<a class="button case-readmore" href="#">							 
Read Case
<span class="button-bg"></span>
</a>

在 Chrome、Firefox、Internet Explorer 等上可以看到预期的结果。

在 Edge 中可以看到奇怪的 bugfest,其中元素正确地转换并且在转换的最后快速向右猛拉。

如果我删除过渡的倾斜部分,就不会再出现抖动。

最佳答案

尝试在悬停前添加默认值。可能存在插值问题。

.button {
display: inline-block;
border: none;
background: transparent;
position: relative;
color: #212121;
font-size: 19px;
line-height: 1;
padding: 0;
margin: 30px;
text-decoration: none;
font-weight: 400;
cursor: pointer;
z-index: 2;
transition: .3s;
transition-timing-function: cubic-bezier(.82, .21, .27, .81);
}

.button-bg {
position: absolute;
padding: 30px;
height: 50px;
border-radius: 0;
left: -30px;
right: -30px;
top: 50%;
transform: translateY(-50%) scaleY(1) scaleX(1) skewY(0deg);
z-index: -1;
transition: .4s;
transition-timing-function: cubic-bezier(.82, .21, .27, .81);
transform-origin: center;
border: 2px solid #212121;
}

a.button:hover .button-bg {
transform: translateY(-50%) scaleY(2) scaleX(1.4) skewY(10deg);
transform-origin: center;
border: 2px solid transparent;
box-shadow: 0px 0px 20px 0px rgba(48, 48, 48, 0.6);
}
<a class="button case-readmore" href="#">							 
Read Case
<span class="button-bg"></span>
</a>

相关:

Weird behavior when rotating an element on hover

matrix not equal to translate and rotate combination in css transform animation?

why this keyframe animation form this animation effect

关于html - 边缘浏览器 : Jerking movement at the end of transition only when skew and translate are used together,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56849230/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com