setAttribute for style
EasonWang01 opened this issue · comments
hi,this is not related for this repo,
If I want to using setAttribute like
<g transform='translate(640 105) rotate(30)' style="position:absolute;left:450px" id="layer1">
x=25;
document.getElementById('layer1').setAttribute('transform','rotate('+x+')');
But the translate(640 105) will be overwrite,how to update the rotate attribute without overwrite other style in transform attribute?
thanks for reply.
Closing, as this is not a CSS help forum. Try stack overflow. In addition, I'd try to answer your question, but I cannot understand what you're asking. Use getAttribute() to get the current transform and then string.replace() to modify it?
thanks!