CSS 转换在 webkit 中有效,但在 FF 中无效
我有一个下拉菜单的代码,在子菜单上有一个过渡:
ul.menu ul {
-moz-transition: visibility 0s linear .55s, opacity .55s linear 0s;
-webkit-transition: visibility 0s linear .55s, opacity .55s linear 0s;
-o-transition: visibility 0s linear .55s, opacity .55s linear 0s;
transition: visibility 0s linear .55s, opacity .55s linear 0s;
visibility: hidden;
opacity: 0;}
ul.menu li:hover > ul {
-moz-transition-delay:0s;
-o-transition-delay:0s;
-webkit-transition-delay:0s;
transition-delay:0s;
visibility: visible;
opacity: 1; }
它在 Chrome 中正确显示,但在 Firefox (7.0.1) 中不正确:为什么? 另一个改变另一个元素背景颜色的过渡效果很好,并且类似的过渡(www.greywyvern.com/?post=337 归功于这个想法!)在 FF 中也同样有效。
I have this code for a drop-down menu, with a transition on the sub-menu:
ul.menu ul {
-moz-transition: visibility 0s linear .55s, opacity .55s linear 0s;
-webkit-transition: visibility 0s linear .55s, opacity .55s linear 0s;
-o-transition: visibility 0s linear .55s, opacity .55s linear 0s;
transition: visibility 0s linear .55s, opacity .55s linear 0s;
visibility: hidden;
opacity: 0;}
ul.menu li:hover > ul {
-moz-transition-delay:0s;
-o-transition-delay:0s;
-webkit-transition-delay:0s;
transition-delay:0s;
visibility: visible;
opacity: 1; }
It displays properly in Chrome but not in Firefox (7.0.1): why?
Another transition changing background-color on another elemet works fine and a similar transition (www.greywyvern.com/?post=337 credit for the idea!) works as well in FF.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
由于这是一个 CSS3 函数,我认为它在 Firefox 中仍然无法使用。查看此页面底部的兼容性表...尝试升级您的浏览器或使用过渡的替代方案。
Since this is a CSS3 function, I assume it's still not a working feature in Firefox. Take a look at the compatibility table on the bottom of this page... Try upgrading your browser or work with an alternative of transitions.
您有太多计时声明:
如果删除最后一个计时
0s
,它将按预期工作。请参阅此处,其中包含您的代码以及上次删除的时间。
You have too many timing declarations:
If you remove the last timing
0s
it will work as expected.See here, with your code and with the last time removed.