Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

233
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda