Cufon 悬停在父元素上
这就是我所拥有的: http://thezoomer.net/clubroyale/
我在 上应用了 Cufon .nav-item 中的一个 元素
Cufon.replace('.nav-item a', {fontFamily: 'Yanone Kaffeesatz',
hover:true,
hoverables: { li:true }
});
这是我在菜单中的内容
<li class="nav-item"><a href="./">HOME</a></li>
,这也是我在 css 中的内容
.nav-item{
color: #a8956c;
background-color:#fff;
cursor:pointer;
white-space:nowrap;
}
.nav-item:hover{
color: #fff;
background-color:#a8956c;
}
显然,我希望 css 悬停能够工作。我知道它在这种状态下不起作用,因为 Cufon 已将刷新绑定到 a 元素而不是整个父元素(与 css 绑定)。但是,如果我将 css 应用到 .nav-item a ,则悬停将起作用,但仅适用于菜单元素的部分。
另外,我尝试在没有 a 的情况下在 .nav-item 上应用 Cufon,悬停有效,但有些 Cufon 无需绘制一些奇怪的空白。
那么,元素是否也可以从父元素接收悬停事件?
谢谢!
This is what I have: http://thezoomer.net/clubroyale/
I applied Cufon on the a element inside the .nav-item
Cufon.replace('.nav-item a', {fontFamily: 'Yanone Kaffeesatz',
hover:true,
hoverables: { li:true }
});
This is what I have inside the menu
<li class="nav-item"><a href="./">HOME</a></li>
and this is what I have inside the css
.nav-item{
color: #a8956c;
background-color:#fff;
cursor:pointer;
white-space:nowrap;
}
.nav-item:hover{
color: #fff;
background-color:#a8956c;
}
Evidently, I want the css hover to work. I know It will not work in this state because Cufon has tied the refresh to the a element and not the whole parent element (which is tied from the css ). However, if I apply the css to .nav-item a the hover will work but only on the portion of the menu element.
Also, I have tried applying Cufon on .nav-item without the a, the hover works but some Cufon draws some weird white spaces without having to.
So, is there something like hoverables: { parent:true } for the element to receive hover events from the parent element too ?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这似乎按预期工作:
JS:
CSS:
This seems to work as expected:
JS:
CSS: