1
@-webkit-keyframes bb{
    from{
        -webkit-transform:translate(0px,0px);
    }
    to{
        -webkit-transform:translate(0px,-100px);
    }
}

How can I change the translate value dynamically with javascript and add a rotate attribute too?

Mike Samuel
  • 118,113
  • 30
  • 216
  • 245
Katti
  • 2,013
  • 1
  • 17
  • 31

1 Answers1

0

From reading the spec, it looks like you can't directly change animation styles by simply changing a property, you have to call some rule manipulation methods, so I think it's going to be something like:

bb.deleteRule( 0 | 1);
bb.insertRule( MyNewRule );

where MyNewRule is a string starting with 0 or 1 depending on whether you wanted to change the from or to rule, and the rest of the string is the style declaration which obviously you'll have to construct first.

But my read of the spec is probably as good or as bad as anyone else's

UPDATE: A MUCH BETTER AND MORE COMPREHENSIVE ANSWER

Community
  • 1
  • 1
Michael Mullany
  • 30,283
  • 6
  • 81
  • 105