问题
I am trying to apply a text-shadow effect to Cufon, following some examples I've found online, but it isn't working.
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.
回答1:
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');
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.
来源:https://stackoverflow.com/questions/5145371/textshadow-not-working-on-cufon