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

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -