【发布时间】:2018-08-24 22:53:39
【问题描述】:
大家好,我的动画需要帮助,我创建了一个循环左右移动的按钮,但鼠标从按钮移出时出现问题。取出鼠标后不流畅会跳转到起始位置。
.hover {
padding: 20px 30px;
font-size: 20px;
font-weight: 500;
background: rgba(33, 150, 243, 1);
transition: all .6s linear;
color: #fff;
margin: 50px;
border: none;
}
.hover:hover {
animation: pulse .6s infinite alternate;
transition: all .6s linear;
}
@keyframes pulse {
0% {
transform: translate(0px)
}
100% {
transform: translate(10px)
}
}
<div>
<button class="hover">Move Right And left</button>
</div>
知道我在这里做错了什么吗?
谢谢:)
【问题讨论】:
-
当涉及到动画时,你无法避免这一点
-
好的,答案很简单,我不能用动画过渡,对吧?
-
是的,给动画添加过渡是没有意义的,所以它不会像你想象的那样工作
-
“所以它不会像你想象的那样工作” 可悲的是:(,但感谢您的回答。
标签: html css loops animation transform