【发布时间】:2017-10-22 08:53:39
【问题描述】:
请参阅 jsfiddle 中的示例。 https://jsfiddle.net/0uwmxt02/1/
在 IE 和 EDGE 中,transform: translateY(-50%) 会导致动画开始和结束时上下跳跃 1px。在 Chrome 中,位移仍然会发生,但它是平滑的。知道是什么原因造成的吗?
.submenu-arrow-hover {
position: relative;
width: 200px;
top:50px;
}
.submenu-arrow-hover:after {
//background: rgba(155, 173, 188, 0.9);
position:absolute;
content:'';
width: 1px;
height: 28px;
border: 1px solid red;
border-right:0;
border-top:0;
top:50%;
right:-1px;
transform-origin: 0 0;
transform: translateY(-50%);
transition-duration: .3s;
}
.submenu-arrow-hover:hover::after {
//background: rgba(155, 173, 188, 0.9);
position:absolute;
content:'';
width: 20px;
height:20px;
border: 1px solid red;
border-right:0;
border-top:0;
top:50%;
right:-1px;
transform-origin: 0 0;
transform: translateY(-50%) rotate(45deg);
}
<div class="submenu-arrow-hover">HOVER ME</div>
【问题讨论】:
标签: css css-transitions