jQuery animate“text-shadow” css属性 [英] jQuery animate "text-shadow" css property
问题描述
因为我已经使用jQuery的 .animate()
方法,我知道,为了使左边距的动画,你必须使用这样的东西:
$('#thing')。animate({marginLeft:20},1000);
这不同于使用css属性 margin-left:20px;
如何使用中的
? text-shadow
animate()
CSS转换是最好的方式,
在这种情况下,您只需设置过渡属性,然后使用JS或更改类来更改样式。 / p>
基本示例: http://jsfiddle.net/adZ42/1/
有关将此更改为jQuery的更多信息: http:// css3。 bradshawenterprises.com/legacy/
So as i've worked with jQuery's .animate()
method i've learned that in order to animate the left margin you would have to use something like this:
$('#thing').animate({marginLeft: 20}, 1000);
Which is different than using the css property margin-left: 20px;
How could I use the text-shadow
property inside animate()
?
CSS transitions are the best way for this, as every browser in common usage that supports text-shadow also supports transitions.
In that case, you just set the transition properties, then change the style either with JS or by changing the class.
Basic example: http://jsfiddle.net/adZ42/1/
More info on retrofitting this into jQuery: http://css3.bradshawenterprises.com/legacy/
这篇关于jQuery animate“text-shadow” css属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!