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

232
Views
How can I increase the size of a circle with zoom and an animation effect using JavaScript?

I have implemented a button and a circle. As soon as you click on the button, the circle is enlarged by 10 times. Unfortunately, this does not happen so nicely. Is there a possibility to add an animation to the enlargement? Unfortunately, I haven't found anything on the internet yet.

function zoom() {
    let example = document.getElementById("a");
    example.style.zoom = 10.0;
  }
div.circle {
      width: 25px;
      height: 25px;
      border-radius: 100%;
      background-color: orange;
    }
<button onclick="zoom()">Zoom</button>
<div id="a" class="circle"></div>

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

0

The zoom property is non-standard. Instead, you should use the transform property and scale the circle.

function zoom() {
  let example = document.getElementById("a");
  example.style.transform = "scale(10,10)";
}
div.circle {
  width: 25px;
  height: 25px;
  border-radius: 100%;
  background-color: orange;
  transition: transform 0.5s;
  transform-origin: top left;
}
<button onclick="zoom()">Zoom</button>
<div id="a" class="circle"></div>

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!