Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

130
Views
Using the CSS transform property with JS - How to use cosine or other angle calculation?

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.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

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)})`
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!