Textshadow不适用于CUFON [英] Textshadow not working on CUFON

查看:87
本文介绍了Textshadow不适用于CUFON的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将文字阴影效果应用到Cufon,按照我在网上找到的一些例子,但它无效。

I am trying to apply a text-shadow effect to Cufon, following some examples I've found online, but it isn't working.

我的代码,在添加文本shado位之前是:

My code, before adding the text shado bit was:

Cufon.replace('h3.upper'); 

...效果很好。然后我补充说:

...which worked perfectly. Then I added:

Cufon.replace('h3.upper', {
textShadow: '-5px -5px #000'
}); 

但它没有做任何事情。字体替换仍然有效,但不是影子。我认为这不重要,但我使用的是联盟哥特式字体。

But it doesn't do anything. The font replacement still works, but not the shadow. I don't think it matters, but I am using the League Gothic typeface.

推荐答案

不知道为什么它不起作用使用这种语法,但我找到了一种不同的方式来起作用:

No idea why it wasn't working with that syntax, but i found a different way to do it that works:

Cufon.replace('h2.no-shadow');
Cufon.replace('h3.no-shadow');
Cufon.set('textShadow', '3px 1px 0 #BF6017'); 
Cufon.replace('h2.with-shadow'); 
Cufon.replace('h3.with-shadow'); 

在Cufon.set之后配置的每个替换都将具有我们指定的属性。这对于组织您的Cufon替换文件也非常有用。希望这对某人有用。

Every replacement configured after the Cufon.set will have the properties that we specify. This can be very useful to organise your Cufon replacements file, as well. Hope this is useful to somebody.

这篇关于Textshadow不适用于CUFON的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆