【发布时间】:2014-10-09 18:14:06
【问题描述】:
以下过渡动画适用于除 Firefox 之外的所有浏览器。我知道您必须初始化要在 Firefox 中转换的属性。在这种情况下,动画、边框、字母间距和背景这三个属性被明确声明了默认值。
>a {
text-align: center;
padding: 10px 0;
display: block;
color: white;
width: 100%;
-webkit-transition: border .5s, letter-spacing .2s, background .5s;
-moz-transition: border .5s, letter-spacing .2s, background .5s;
-ms-transition: border .5s, letter-spacing .2s, background .5s;
-o-transition: border .5s, letter-spacing .2s, background .5s;
transition: border .5s, letter-spacing .2s, background .5s;
background: transparent;
letter-spacing: 1px;
border-top: 1px solid transparent;
border-bottom: 1px solid transparent;
}
>a:hover {
background: blue;
border-bottom: 1px solid #ccc;
border-top: 1px solid #ccc;
letter-spacing: 2px;
}
子菜单元素是过渡动画适用于除 Firefox (v.31 OS X) 之外的所有设备的元素。
(对于小提琴中冗长而神秘的 CSS,我深表歉意,我使用的是 SASS。我已将 CSS 的相关部分注释为:
/*
TWISTED TRANSITION
*/
帮助你找到它)
编辑:
看到 Fabio 的评论,我想知道其他人是否可以给我留下评论,如果它对他们有用。我开始怀疑这不是 OS X FireFox 的故障。
【问题讨论】:
-
在 FF 中非常适合我,不知道你是什么意思
-
@Fabio 悬停效果在 FF 中适用于我,但它不是动画的。这是一个即时的变化,就好像没有设置
transition:参数一样。例如,在 Chrome 中,我得到了漂亮而平滑的过渡效果。可能是我的版本和我的操作系统,FF 31 OS X。同时清除了缓存,甚至重新启动了我的笔记本电脑,问题肯定仍然存在。我也很困惑为什么父菜单的过渡动画效果很好。
标签: css firefox transition css-animations