I have this stylesheet:
@-webkit-keyframes run {
0% {
-webkit-transform: translate3d(0px, 0px, 0px);
}
100% {
-webkit-transform: translate3d(0px, 1620px, 0px);
}
}
Now, I would like to modify the value of 1620px depending on some parameters. Like this:
@-webkit-keyframes run {
0% {
-webkit-transform: translate3d(0px, 0px, 0px);
}
100% {
-webkit-transform: translate3d(0px, height*i, 0px);
}
}
I would prefer to be able to use JavaScript and jQuery, though a pure CSS solution would be ok.
This is for an iPhone game that runs in it’s mobile Apple Safari browser.
Use the CSSOM
If you want to modify a keyframe rule in a stylesheet that’s already included, do the following:
If you don’t know the order but do know the URL of the CSS file, replace
document.styleSheets[0]withdocument.querySelector("link[href='your-css-url.css']").sheet.