html - div 的 CSS3 变换比例导致在 Firefox 中跳跃子元素

标签 html css firefox

我正在尝试缩放 CSS3 中的元素。这个元素有子元素,当动画完成时它们会跳来跳去。这似乎只发生在 Firefox 中。我一直在尝试在 SO 上找到的很多修复程序,但似乎没有一个能完成这项工作。

我的 HTML 设置:

<div>
<ul>
  <li class="appcenter-menu-item focus">
    <a href="#/sp">
      <div class="icon"></div>
        <label>First item</label>
    </a>
  </li>
  <li class="appcenter-menu-item focus">
    <a href="#/pep">
      <div class="icon"></div>
      <label>Second item</label>
    </a>
  </li>
    <li class="appcenter-menu-item focus">
      <a href="#/hp">
        <div class="icon"></div>
        <label>Third Item</label>
      </a>
    </li>
</ul>
</div>

悬停时的过渡:

.focus {
    -webkit-transition: all 0.5s ease-in-out;
    -moz-transition: all 0.5s ease-in-out;
    -o-transition: all 0.5s ease-in-out;
    -ms-transition: all 0.5s ease-in-out;
    transition: all 0.5s ease-in-out;
}
.focus:hover {
    -webkit-transform: translate3d(0,0,0);
    -moz-transform: translate3d(0,0,0);
    -o-transform: translate3d(0,0,0);
    -ms-transform: translate3d(0,0,0);
    transform: translate3d(0,0,0);
    transform: scale(1.1);
}

我创建了一个显示完整设置的 jsfiddle:

http://jsfiddle.net/kwhq2z4t/3/

更新

我在 Windows 7 x64 上使用 FireFox 版本 32.0.1。

最佳答案

刚刚在 firefox 中遇到了这个“jump-after-transition-finished”错误。

经过一番折腾后,将 -moz-transform-style: preserve-3d; 添加到动画元素的父容器中 - 将其添加到初始状态(过渡发生前的非动画状态 -所以那只是 .focus 类)- 为我完成了这项工作。

关于html - div 的 CSS3 变换比例导致在 Firefox 中跳跃子元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25868002/

相关文章:

javascript - 进入特定的全屏部分时是否可以更改标题背景?

javascript - 在函数参数上使用时包含不是函数

html - 轮播滑动动画不适用于 Bootstrap 4.5.2

css - 为什么我的 HTML5 代码不起作用?

javascript - 如何使用 JavaScript/XUL 向新的浏览器选项卡发出发布请求?

javascript - JavaScript 不应该忽略空格吗? Firefox 中的节点怪癖

javascript - 是否可以在输入元素上使用多种类型属性

css - 子导航扩展常规导航和错误对齐

css - 在移动 chrome/safari 中隐藏输入 [类型 ="month"] 清除按钮

eclipse - 从 Eclipse 中使用自定义 Firefox 配置文件启动 Selenium