【问题标题】:Cufon Not ShowingCufon 不显示
【发布时间】:2026-01-06 00:10:01
【问题描述】:

我不明白为什么我的 Cufon 无法正常工作,所有 .js 文件都可以正常加载:

    <!DOCTYPE html>
<html lang="en">
<head>

<title>Company Name</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="includes/css/style.css?v=2" media="all">
<!-- Grab Google CDN's jQuery. fall back to local if necessary -->
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
    <script>!window.jQuery && document.write(unescape('%3Cscript src="includes/js/jquery-1.6.min.js"%3E%3C/script%3E'))</script>
<script src="includes/js/cufon.js"></script>
<script src="includes/js/Springsteel_Lig_300.font.js"></script>
<script>
        window.addEvent('domready',function() {
                    Cufon.replace('header h1');
                });
</script>
<body>

<div id="container">

<header>
                <h1>Company</h1>
                <div id="logo"><a href="http://Company.co.nz/">Home</a></div>

【问题讨论】:

    标签: javascript html cufon


    【解决方案1】:

    尝试改变:

    <script>
        window.addEvent('domready',function() {
            Cufon.replace('header h1');
        });
    </script>
    

    只是:

    <script type="text/javascript">
        Cufon.replace('header h1');
    </script>
    

    经过这样的更改后它对我有用(使用 Vegur.font.js 字体,在 Opera 11 和 Google Chrome 11 上测试过)。

    编辑:

    也适用于Springsteel_Lig_300.font.js 字体。我刚刚下载了Springsteel Light字体(springsteel-lig.otf)并使用that site生成js格式。

    【讨论】: