我有一个网站,它以一种奇怪的方式使用cufon字体(至少我以前没有见过)。我正在尝试更改这些字体,因为它们很奇怪。为显示一个简单的"Stock Products“而编写的代码如下:
<h2><cufon class="cufon cufon-canvas" alt="Stock " style="width: 68px; height: 26px; "><canvas width="93" height="29" style="width: 93px; height: 29px; top: -3px; left: -3px; "></canvas><cufontext>Stock </cufontext></cufon><cufon class="cufon cufon-canvas" alt="Products" style="width: 96px; height: 26px; "><canvas width="116" height="29" style="width: 116px; height: 29px; top: -3px; left: -3px; "></canvas><cufontext>Products</cufontext></cufon></h2>它们只在标题中包含一个cufon.js文件。
我尝试像这样替换字体:
<script src="scripts/cufon-yui.js" type="text/javascript"></script>-->
<script src="scripts/Adobe_Fan_Heiti_Standard_OpenType_600.font.js" type="text/javascript"></script>
<script type="text/javascript">
Cufon.replace('h2','h1','h3','h4');
</script>这根本不起作用。代码太长,文件太多,无法在任何地方手动编辑代码。请提出一些解决方案。
提前感谢!
发布于 2013-02-16 21:44:16
您的cufon语法似乎不正确。在一开始,而不是
Cufon.replace('h2','h1','h3','h4');试一试
Cufon.replace('h2');根据Cufon API,要实现您的代码所指示的功能,您必须使用:
Cufon.replace('h1')('h2')('h3')('h4');或者,如果您在站点上使用jQuery或类似的JS框架,则可能是:
Cufon.replace('h1, h2, h3, h4');有关更多信息,请参阅:https://github.com/sorccu/cufon/wiki/API
https://stackoverflow.com/questions/14708851
复制相似问题