我希望我的动画工作的站点在我的任何标签之前添加#user-space。所以,我的动画看起来像这样:
#user-space @-webkit-keyframes animation-name {
from {
style definition ["Before"-state]
}
to {
style definition ["After"-state]
}#user-space声明破坏了css语句,动画也无法工作。有没有别的办法呢?例如,将我的关键帧像webkit-animation: from { style definition ["Before"-state] } to { style definition ["After"-state] } 1.1s ease infinite;一样放入insine webkit-animation: animation-name 1.1s ease infinite;
发布于 2012-11-20 16:11:22
我看到的解决方案是绕过你的问题,用javascript来做。
只需在html文件(在标题中)中添加一个新的style并在其中添加@-webkit-keyframes动画即可。
有一个线程很好地解释了这一点(参见公认的解决方案):Set the webkit-keyframes from/to parameter with JavaScript
https://stackoverflow.com/questions/13415645
复制相似问题