Cufon:链接在悬停时改变大小并保持这种状态
我在一个段落中有文本链接,使用 Cufon 替换它。 由于某种原因,当我将鼠标悬停在链接上时,其中的文本会变宽,并且当我将光标移开时保持这种状态。添加到 CSS 中悬停的颜色更改会按预期恢复。所以据我所知,它并没有“卡在”悬停状态。
当我关闭 javascript 并禁用 cufon 时,悬停时字体只会发生颜色变化。关闭 JavaScript 后,悬停状态适用于颜色,但不存在宽度问题。
这种情况发生在 IE6、7 和 IE6 中。 8,以及 Firefox、Safari 和 Chrome,这让我相信这个问题是这个网站上 Cufon 的实现方式所特有的。
有人遇到过这个吗? 我希望在这里得到帮助,但如果我找到原因,我会将其作为答案发回。
不幸的是,由于保密协议,我无法发布链接或代码。
I have text links in a paragraph which is replaced using Cufon.
For some reason, when I hover over the links, the text in them gets wider, and stays that way when I move the cursor away. A colour change, added to hover in the css, reverts as one would expect. So it isn't "stuck" in the hover state as far as I can tell.
When I turn javascript off, disabling cufon, there is only a color change change to the font on hover. With javascript off, the hover state works for colour, but it dosn't have the width problem.
This happens in IE6, 7 & 8, as well as Firefox, Safari and Chrome, which leads me to believe the problem is peculiar to how Cufon has been implemented on this site.
Anybody run into this before?
I'd love an assist here, but if I find the cause, I'll post it back as an answer.
Unfortunately I can't post links or code due to an NDA.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
知道了。
曾有一段:
我的结论是,该问题是由于默认文本被压缩而不是链接而导致的,这就是为什么 Cufon 可以理解地给出了反直觉的结果,这是反直觉配置的结果。
我将其替换为:
此后,默认情况下所有字体都处于(稍)宽的状态。
另一种选择是在链接元素的声明中附加“fontStretch: 'semi-condensed'”,但我实际上发现该网站现在更符合概念设计,并且更具可读性,这是一个意想不到的好处。
你可能已经猜到了,我没有在这个网站上实现 cufon。希望这个页面能帮其他人省去麻烦。
Got it.
There was a section:
I concluded that the issue was a result of the default text being condensed by default but not the links, which is why Cufon understandably gave counter-intuitive results, as a result of a counter-intuitive configuration.
I replaced it with:
After this, all the font was in the (slightly) wider state by default.
Another option would have been to append "fontStretch: 'semi-condensed'" to the decalration for link elements, but I actually find the site better matches the concept designs better now and is more readable, which is an unexpected bonus.
You may have guessed, I didn't implement the cufon on this site. Hopefully this page will save somebody else a headache.