javascript - Cufon 悬停和更改字体语法

标签 javascript cufon

有人可以帮我重写下面的语法以使其正确吗。

我希望在接受 :hover 时将字体替换为我的字体,这样当我将鼠标悬停在它上面时我的按钮就会改变。

 Cufon('button', {
    fontFamily: 'Disgrunged A',
    hover: {
        color: '#ed1c24'
    }
 });

最佳答案

您可以尝试将按钮添加到 hoverables 列表中

Cufon('button', {
    fontFamily: 'Disgrunged A',
    hover: {
        color: '#ed1c24'
    },
    hoverables: { button:true }
 });

引用:Cufon API

hoverables
Defines which elements :hover is used with. Defaults to links only as IE6 can’t handle anything else.
example : { tag: true, .. }
default : { a: true }

关于javascript - Cufon 悬停和更改字体语法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2727814/

相关文章:

javascript - 在自定义 jQuery 菜单上维护状态时遇到问题

jquery - 文本在 div 下方偏移

javascript - 用于 javascript 模板字符串的 Polyfill

html - 如何选择Cufon字体?

ajax - Ajax加载后重新加载Cufon,请帮忙

css - li :hover with Cufon 行为迟缓

JavaScript 停止事件流

javascript - 从 wordpress javascript 文件中删除注入(inject)的恶意软件

javascript - 为什么我们需要安装 http 模块来运行我们的 Node js 应用程序?