悬停在父列表项上时更改链接颜色时出现奇怪的行为

发布于 2024-12-03 13:22:10 字数 432 浏览 4 评论 0原文

我的问题可以在这里看到 - http://jsfiddle.net/aBSyH/3/

我是使用 cufon 文本替换并认为这就是问题的根源。

当您将鼠标悬停在列表项及其内容内外时,链接的颜色应该会发生变化。但它的行为很奇怪。有时它会变回蓝色,但通常保持红色。

似乎有问题

li.mainmenu:hover a {
    color:red;   
}

使用 cufon 文本和选择器(例如 -当鼠标离开 li 的悬停区域时,cufon 文本不会恢复为原始颜色)

。知道为什么吗?

我更愿意在不添加任何 javascript 的情况下解决问题(除了更改 cufon 初始化代码之外)。

My issue can be seen here - http://jsfiddle.net/aBSyH/3/

I'm using cufon text replacement and think that's the source of the issue.

The link's color should change when you hover in and out of the list item and it's content. But it's behaving quite strangely. It changes back to blue sometimes but generally stay red.

There seems to be something wrong with using cufon text and a selector like -

li.mainmenu:hover a {
    color:red;   
}

The cufon text does not revert to it's original colour when the mouse leaves the li's hover area.

Any idea why?

I'd prefer to fix the issue without adding any javascript (apart from chaging the cufon initialisation code).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

再可℃爱ぅ一点好了 2024-12-10 13:22:10

马金为我指明了正确的方向,如果我能再次投票支持他的答案,我会的。

我真的应该先阅读说明 - https://github。 com/sorccu/cufon/wiki/FAQ#wiki-faq-10

这就是我修复它的方法 -

Cufon.replace('ul#onesite_navigation > li', {
    hover: true,
    hoverables: { li: true },
    ignore: { ul: true },
    textless: { li: true }
});

Marjin pointed me in the right direction, if I could up vote his answer again I would.

I really should have read the instructions to begin with - https://github.com/sorccu/cufon/wiki/FAQ#wiki-faq-10

This is how I fixed it -

Cufon.replace('ul#onesite_navigation > li', {
    hover: true,
    hoverables: { li: true },
    ignore: { ul: true },
    textless: { li: true }
});
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文