CSS 转换在 webkit 中有效,但在 FF 中无效

发布于 2024-12-14 14:42:20 字数 763 浏览 4 评论 0原文

我有一个下拉菜单的代码,在子菜单上有一个过渡:

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

衣神在巴黎 2024-12-21 14:42:21

由于这是一个 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.

自此以后,行同陌路 2024-12-21 14:42:21

您有太多计时声明:

-moz-transition: visibility 0s linear .55s, opacity .55s linear 0s;

如果删除最后一个计时0s,它将按预期工作。

请参阅此处,其中包含您的代码以及上次删除的时间。

You have too many timing declarations:

-moz-transition: visibility 0s linear .55s, opacity .55s linear 0s;

If you remove the last timing 0s it will work as expected.

See here, with your code and with the last time removed.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文