css - 为什么 CSS3 透视变换在 Firefox 中不起作用

标签 css firefox

我正在尝试为下拉菜单创建一个 css 转换,但它在 firefox 中不起作用,这是 css 代码:

@-webkit-keyframes flipInX {
  0% {
    -webkit-transform: perspective(400px) rotateX(90deg);
    transform: perspective(400px) rotateX(90deg);
    opacity: 0;
  }

  100% {
    -webkit-transform: perspective(400px) rotateX(0deg);
    transform: perspective(400px) rotateX(0deg);
    opacity: 1;
  }
}

@keyframes flipInX {
  0% {
    -webkit-transform: perspective(400px) rotateX(90deg);
    -ms-transform: perspective(400px) rotateX(90deg);
    transform: perspective(400px) rotateX(90deg);
    opacity: 0;
  }

  100% {
    -webkit-transform: perspective(400px) rotateX(0deg);
    -ms-transform: perspective(400px) rotateX(0deg);
    transform: perspective(400px) rotateX(0deg);
    opacity: 1;
  }
}

.flipInX {
  -webkit-backface-visibility: visible !important;
  -ms-backface-visibility: visible !important;
  backface-visibility: visible !important;
  -webkit-animation-name: flipInX;
  animation-name: flipInX;
}

那么firefox改造有专门的代码吗? 什么是困惑?

最佳答案

检查这个 fiddle ,看看它是否适合你。 http://jsfiddle.net/jybenjya/

它对我来说很好用。但您唯一需要更改的是为动画添加时间,方法是添加“animation-duration:”或将“animation-name”更改为“animation”并在末尾添加时间,如下所示

-webkit-animation: flipInX 3s;
animation: flipInX 3s;

为了安全起见,我通常包括所有前缀(firefox 为 moz)

  -webkit-animation: flipInX 3s;
     -moz-animation: flipInX 3s;
       -o-animation: flipInX 3s;
          animation: flipInX 3s;

-webkit-transform:
   -moz-transform:
    -ms-transform:
     -o-transform:
        transform:

等等,但在我的 jsfiddle 中我似乎不需要包含它们。

关于css - 为什么 CSS3 透视变换在 Firefox 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26625825/

相关文章:

css - Material design Lite 抽屉导航,如 google Android 和 You Tube

jquery - 隐藏/显示*非常*慢

html - 水平对齐三个按钮(左、中、右)

css - Firefox 5 不呈现样式字体粗细 : 900

jquery - 导航上的 Slick Slider Jumping - 可变宽度和中心模式

c# - https 代理服务器中的 firefox 证书问题

javascript - JavaScript 的 localstorage 字符串存储在哪里?

css - 在 CSS 中覆盖禁用 Firefox 的 "allow pages to choose their own fonts"?

适用于 IE 和 firefox 的 CSS 页脚

css - 选中的复选框如何更改 div 的 z-index?