Set the webkit-keyframes from/to parameter with JavaScript -
is there way set from
or to
of webkit-keyframe javascript?
a solution of sorts:
var cssanimation = document.createelement('style'); cssanimation.type = 'text/css'; var rules = document.createtextnode('@-webkit-keyframes slider {'+ 'from { left:100px; }'+ '80% { left:150px; }'+ '90% { left:160px; }'+ 'to { left:150px; }'+ '}'); cssanimation.appendchild(rules); document.getelementsbytagname("head")[0].appendchild(cssanimation);
just adds style definition header. cleaner/better define though dom if possible.
edit: error in chrome old method
Comments
Post a Comment