Cufon加载问题
我之前已经使用过很多次 cufon 并且从未遇到过问题,但无论我如何安装此安装,我都会收到 firebug 错误:“cufon 未定义”。
我还没有编写太多页面,因此我将在此处发布一个链接,以便您可以看到它的实际效果: http://www.stormcouriers.com/testimonials
我使用以下代码来包含这些文件:
<link type="text/javascript" href="system/pyrocms/themes/minimal/assets/js/cufon-yui.js"/>
<link type="text/javascript" href="system/pyrocms/themes/minimal/assets/js/microgramm_400-microgramm_400.font.js"/>
<link type="text/javascript" href="system/pyrocms/themes/minimal/assets/js/jquery-1.4.2.min.js"/>
<link type="text/javascript" href="system/pyrocms/themes/minimal/assets/js/html5.js"/>
<link type="text/javascript" href="system/pyrocms/themes/minimal/assets/js/common.js"/>
<script type="text/javascript">
Cufon.replace('h2');
Cufon.now();
</script>
所有 js 文件均正确加载,因此我正在绞尽脑汁地想弄清楚这一点。我看到的唯一问题是我使用的是 codeigniter CMS,并且网上有一些关于 CI 和 Cufon 之间问题的帖子。任何帮助将不胜感激。
谢谢
戴夫
I've used cufon plenty of times before and never had an issue, but no matter what I do with this installation I just get firebug error : "cufon not defined".
I don't have much of the page written yet so I'll post a link here so you can see it in action: http://www.stormcouriers.com/testimonials
I'm using the following code to include the files:
<link type="text/javascript" href="system/pyrocms/themes/minimal/assets/js/cufon-yui.js"/>
<link type="text/javascript" href="system/pyrocms/themes/minimal/assets/js/microgramm_400-microgramm_400.font.js"/>
<link type="text/javascript" href="system/pyrocms/themes/minimal/assets/js/jquery-1.4.2.min.js"/>
<link type="text/javascript" href="system/pyrocms/themes/minimal/assets/js/html5.js"/>
<link type="text/javascript" href="system/pyrocms/themes/minimal/assets/js/common.js"/>
<script type="text/javascript">
Cufon.replace('h2');
Cufon.now();
</script>
All js files load correctly, so I'm scratching my head to figure this one out. The only problem I can see is that I am using a codeigniter CMS and there are a few posts on the web of prblems between CI and Cufon. Any help would be greatly appreciated.
Thanks
Dave
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,弄清楚了 - 当您查看源代码时,通常将 javascript 添加到 codeignitor 主题中似乎可以工作,但不能在页面中运行。使用 Pyrocms,我最终使用以下命令包含了 js 文件:
{pyro:theme:js file="js/cufon-yui.js"}
这使得 javascript 正确加载,因此 Cufon 可以工作。
Ok figured this out - adding javascript normally into the codeignitor theme appears to work when you view the source, but doesn't run in page. Using Pyrocms I ended up including the js files using:
{pyro:theme:js file="js/cufon-yui.js"}
This made the javascript load correctly and therefore Cufon work.