如何正确实施 jQuery Sifr 插件?
我整个下午都在尝试获取 jQuery Sifr 插件 (http://jquery.thewikies.com/sifr/ )去工作,但没有成功。 该插件的网站上的文档有限,对于看起来如此简单的事情,我确信我一定已经接近那里了。 我还在 http://www.eona.com/sifr/ 找到了一些信息,但我认为它适用于旧版本的插件。
我使用在线 Sifr Generator 制作了自己的字体文件 (http://www.sifrgenerator.com/ )以及我自己使用 Flash CS4 似乎都不起作用。
这是我的代码:
$(document).ready(function(){
$.sifr({
path: 'http://**.com/js/',
save: true
});
$('.pageInfo h1').sifr({
font: 'soho',
debug: true
});
});
现在,“save:true”不在这个插件的文档中,但我确实在插件网站的其他地方找到了它,有趣的是,没有它,什么也不会发生,但是包含它,我得到的只是是默认的“使用 sIFR3 渲染”消息,而不是我的元素的文本。
该插件的网站还显示“它支持 sIFR 版本 2 和版本 3 字体。”,这是什么意思? 我的字体文件可以是较新的 v3 类型吗?
我真的很感激任何和所有的帮助。
先感谢您
I have been trying all afternoon to get the jQuery Sifr Plugin (http://jquery.thewikies.com/sifr/) to work, without success. The plugin's site has limited documentation and for something so apparently easy, I'm sure I must be nearly there. I also found some info at http://www.eona.com/sifr/ but I think it's for an older version of the plugin.
I have made my own font files using the online Sifr Generator (http://www.sifrgenerator.com/) and also on my own using Flash CS4 and neither seem to work.
Here's my code:
$(document).ready(function(){
$.sifr({
path: 'http://**.com/js/',
save: true
});
$('.pageInfo h1').sifr({
font: 'soho',
debug: true
});
});
Now, the "save: true" is not in the docs for this plugin but I did find it elsewhere on the plugin's site, the funny thing is, that without it, nothing happens but with it included, all I get is the default "Rendered with sIFR3" message instead of the text of my element.
The plugin's site also says "It supports sIFR version 2 and version 3 fonts.", what does this mean? Could my font files be in the newer v3 type?
I would really appreciate any and all help.
Thank you in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我在这里!
不好意思推迟了。 :)
您必须至少指定内部版本和版本。
这是一个示例:
Here I Am!
Sorry for delay. :)
You must specify at least build and version.
Here's a sample:
我在使用 jQuery 插件(现在使用 sIFR 3)时遇到了同样的问题,对我来说,预发布的 swf 是 << 版本 436 - 特别是来自 sifrvault 的字体。 可能您的字体需要重新发布,请获取 ttf 并使用 OpensIFRr。
-杰伊
I had the same issue using the jQuery plugin (which uses sIFR 3 now), for me it was that the pre-published swf's were < version 436 - specifically fonts from sifrvault. Likely your font needs to be re-published, grab the ttf and use OpensIFRr.
-Jay
您是否尝试过跳过字体选项并将对 swf(包括 .swf 文件扩展名)的直接引用传递给路径选项? 几周前我尝试了该插件,我认为这可能是开始工作所必需的。
YMMV,但我的经验是,插件中潜入了许多奇怪的小错误,并且使用官方 sIFR 2.0 在文档(就绪)代码中运行正常的 sifr.replaceElement 远没有那么令人沮丧(而且同样简单和高性能) .7 版本来自 http://wiki.novemberborn.net/sifr/。
Have you tried skipping the font option and passing a direct reference to the swf (including the .swf file extension) to the path option? I experimented with that plugin just a few weeks ago I think that may have been necessary to get things started.
YMMV, but my experience was that many odd little bugs crept in w/ the plugin and it's was far less frustrating (plus just as easy and performant) to run a normal sifr.replaceElement inside your document(ready) code using the official sIFR 2.0.7 release from http://wiki.novemberborn.net/sifr/.
我不相信 jQuery 插件与 sIFR 3 兼容(无论如何我建议您使用它)。
I don't believe the jQuery plugin is compatible with sIFR 3 (which I would recommend you use anyway).