How we can add transform rotate and scale simultaneously in .setAttribute

I’m working on an SVG an I want to add a scale and rotation transform. The rotate value is dynamic and the scale value is constant.

I tried like this:

boxElem.setAttribute("transform", "rotate(" + rotation + "), scale(0.9)");

It is not working. Only the scale value is having an effect. Can anyone tell me how to add multiple properties inside transform in JS.

20 thoughts on “How we can add transform rotate and scale simultaneously in .setAttribute”

  1. hello there and thank you for your information –
    I’ve certainly picked up something new from right here. I did however expertise several
    technical points using this website, as I experienced to reload the
    website many times previous to I could get it to load properly.
    I had been wondering if your web hosting is OK? Not that I’m complaining,
    but slow loading instances times will often affect your placement in google and can damage your high quality
    score if ads and marketing with Adwords. Anyway I’m adding this RSS to my e-mail and can look
    out for much more of your respective interesting content.
    Make sure you update this again very soon. http://antiibioticsland.com/Cephalexin.htm

    Reply

Leave a Comment