我有一个车速表。我想显示速度取决于在文本框中输入的值。 Here is the demo。这里是代码,如果你想browse。我需要更新值的主要代码是。我可以将值传递给CSS函数吗?
@-webkit-keyframes rotate {
from {-webkit-transform:rotate(0deg);}
to {-webkit-transform:rotate(180deg);} <-- I need to update 180deg on the fly
}
在理想情况下,我需要从数据库中提取这个值。但只是想知道是否有办法在旅途中更新该字段?可能是JavaScirpt?
注:该演示只能在Safari和Chrome,而不是在Firefox和IE
我想我可以使用jQuery来创建CSS功能? –
[以编程方式更改动画规则中的webkit转换值]的可能重复(http://stackoverflow.com/questions/5105530/programmatically-changing-webkit-transformation-values-in-animation-rules) – thirtydot