【问题标题】:IE Fallback for Hover animation悬停动画的 IE 后备
【发布时间】:2016-09-07 14:19:44
【问题描述】:

我正在尝试在 Internet Explorer 中将鼠标悬停在元素上。

在 Chrome 中,元素 pops 看起来很整洁,但在 IE 中却没有:(

目前在背景颜色出现之前有一个时间延迟。

我猜-webkit-animation-name 是我问题的根源。

http://jsfiddle.net/8j249sre/

<div class="effects">
    <a class="hvr-pop" href="#">Pop</a>
</div>


/* Pop */
@-webkit-keyframes hvr-pop {
  50% {
    -webkit-transform: scale(1.2);
    transform: scale(1.2);
  }
}

@keyframes hvr-pop {
  50% {
    -webkit-transform: scale(1.2);
    transform: scale(1.2);
  }
}

.hvr-pop {
  display: inline-block;
  vertical-align: middle;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  box-shadow: 0 0 1px rgba(0, 0, 0, 0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -moz-osx-font-smoothing: grayscale;
}
.hvr-pop:hover, .hvr-pop:focus, .hvr-pop:active {
  -webkit-animation-name: hvr-pop;
  animation-name: hvr-pop;
  -webkit-animation-duration: 0.3s;
  animation-duration: 0.3s;
  -webkit-animation-timing-function: linear;
  animation-timing-function: linear;
  -webkit-animation-iteration-count: 1;
  animation-iteration-count: 1;
}

【问题讨论】:

  • 请指定出现此问题的 IE 版本。使用 IE11 测试,行为与 Chrome 相同。
  • @Serlite 好主意!在 IE11 中遇到问题 :-)
  • 你知道你的小提琴不包含css动画吗?
  • 是的,但这对我们没有帮助,因为您正在寻求有关 css 动画的帮助,但没有...
  • 如果您介意,是否有可能将其放入 SO sn-p 中?只需简化问题并仅包含您正在测试的动画,以便我们了解可能存在问题的位置。

标签: javascript jquery html css internet-explorer


【解决方案1】:

将此添加到我的.hvr-pop:hover, .hvr-pop:focus, .hvr-pop:active { 解决了我的问题:-)

-ms-animation-name:none;

【讨论】:

  • @Charles 在我看来不够详细。我有 2 天的时间来接受这个答案,坦率地说,在这个时间范围内需要详细说明。
  • 那我想我真正的问题是你为什么不现在添加细节?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-07-15
  • 2021-04-02
  • 2020-10-14
  • 2015-05-06
  • 2019-05-06
相关资源
最近更新 更多