Reputation: 667
when I call this in my JS :
block.style.transform = "rotate(67.5deg) skewX(45deg) scaleY(cos(45deg))";
Nothing happens on my page, and the console returns an error :
Error in parsing value for ‘transform’. Declaration dropped.
Thos problem is with the last parameter and the cosine.
I tried using Interpolation syntax for the calculation but it doesn't work.
Upvotes: 0
Views: 132
Reputation: 1365
You will need to calculate the cos value before you assign the style.
You could use template literals to ` execute the code inline.
elem.style.transform = `rotate(67.5deg) skewX(45deg) scaleY(${Math.cos(45)})`
Upvotes: 1