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

269
Views
Add '-ms-transform' and '-webkit-transform' to element using vanilla js

I am removing jQuery and need to be able to add these css transform attributes to an element using vanilla js:

    -ms-transform: scale(1.05); /* IE 9 */
    -webkit-transform: scale(1.05); /* Safari */
    transform: scale(1.05);

Today I have the code changed with jQuery like:

    $(".my-class").css({
        '-ms-transform': 'scale(1.05)', /* IE 9 */
        '-webkit-transform': 'scale(1.05)', /* Safari */
        'transform': 'scale(1.05)',
    })

The problem is to do something like:

$element.style.-ms-transform = 'scale(1.05)'

But this does not work ๐Ÿ‘†

about 4 years ago ยท Juan Pablo Isaza
1 answers
Answer question

0

Try doing it like this:

$element.style["-ms-transform"] = 'scale(1.05)'

Remember that you can access objects like arrays with strings. W3Schools page on Objects

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!