【发布时间】:2015-02-05 00:56:09
【问题描述】:
我要做的是根据我得到的变量,将关键帧中的 100% 旋转值更改为新的计算值。我使用 Javascript 来执行此操作没有问题,但我希望它在外部 CSS 中完成,而不是内联,一旦更改,我需要重新启动动画。这可能吗?如果是这样,怎么做? (注意所有当前都通过按钮单击完成)这不会被保存,仅用于使用新位置更新图形。
.arrow {
-webkit-animation: rotate 3s linear 0 1;
animation: rotate 3s linear 0 1;
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
-webkit-animation-play-state: paused;
animation-play-state: paused;
visibility: visible !important;
}
@-webkit-keyframes rotate {
0% {
-webkit-transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
}
}
@keyframes rotate {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
任何帮助将不胜感激!我一直在努力寻找可以使用大约一周的东西。
【问题讨论】:
-
Javascript 不能更改外部文件,它可以访问外部样式表,但不能保存它们,这将是更改外部样式表中样式的唯一原因
标签: javascript css rotation css-animations