本文介绍了带有jQuery的文本阴影的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望使用javascript更改元素的text-shadow属性.据我所知,jQuery CSS不适用于文本阴影.
I wish to change the text-shadow attribute of elements with javascript. As far as I know jquery css does not work with text-shadow.
有人对动态更改文本阴影有任何建议吗?
Does anyone have any suggestions for dynamically changing text-shadow.
谢谢!
推荐答案
为我工作(Chrome和FF,而不是IE).
Works for me (Chrome and FF, not IE).
尝试使用camelCase.在JavaScript中使用CSS属性时,必须删除连字符(例如,"background-image"将变为"backgroundImage"),然后设置属性.
Try using camelCase. When working with CSS properties in JavaScript, you have to remove the hyphen (for example, "background-image" would become "backgroundImage") and then set the properties.
因此您的代码应为:
这篇关于带有jQuery的文本阴影的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!