小编Wik*_*ała的帖子

如何在没有跳跃的情况下减慢悬停元素上的CSS动画?

我正在尝试在css中制作选框,这会在悬停在元素上时减慢速度.我已经完成了类似的操作,但它并没有停止主动画,当鼠标退出选框时,它会回到它的位置,好像我什么也没做.

这是CSS和HTML中的代码

.prices {
  background-color: #f5fafd;
  font-size: 14px;
  padding: 6px 0;
  border-bottom: solid 1px #d9d9d9;
  margin-left: 0;
  margin-right: 0;
}

.currency {
  text-align: center;
  color: #444444;
  font-weight: 300;
}

.marquee {
  height: 30px;
  min-width: 640px;
  width: 100%;
  overflow: hidden;
  position: relative;
}

.marquee p {
  position: absolute;
  width: 640px;
  height: 100%;
  margin: 0;
  line-height: 30px;
  text-align: center;
  transition: all 0.3s ease;
  transform: translateX(100%);
  animation: scroll-left 20s linear infinite;
}

.marquee:hover p {
  transform: translateX(100%);
  animation: scroll-left 30s linear infinite;
} …
Run Code Online (Sandbox Code Playgroud)

html css css3 css-animations

9
推荐指数
1
解决办法
857
查看次数

标签 统计

css ×1

css-animations ×1

css3 ×1

html ×1