Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

112
Vistas
Evite el retraso al escalar la imagen

Tengo este problema, mi imagen es muy lenta cuando la estoy escalando usando transform: scale(); propiedad en CSS. Estoy escalando la imagen de 0 a 1.

Mi imagen se ha reducido mucho, así que no creo que el problema pueda venir de aquí.

Aquí hay un video del problema real: lag image video

Aquí está el HTML:

 <div class="picture-container first-part"> <div class="picture-frame first-part" :style="{ width: pictureFrameWidth + '%', height: pictureFrameHeight + 'vh', }" > <img src="../assets/pictures/cathedrale.jpg" alt="picture of Notre Dame de Reims" class="picture top-left" id="firstPic" :style="{ transform: 'scale(' + pictureScale + ')' }" /> </div> </div>

CSS:

 .picture-container { display: flex; flex-flow: row nowrap; justify-content: center; justify-self: center; align-items: center; width: 40%; height: 100vh; } .picture-container.first-part { position: sticky; top: 0px; } .picture-frame { display: flex; flex-flow: row nowrap; justify-content: center; align-items: center; padding: 5%; border: solid 1px var(--color); } .picture { z-index: 1; width: 100%; height: 100%; }

J.S.:

 constrain(n, high, low) { return Math.max(Math.min(n, high), low); }, resizePicture() { this.pictureScale = window.scrollY / 1500 - 0.75; let constrainedPictureScale = this.constrain(this.pictureScale, 1, 0); this.pictureScale = constrainedPictureScale; }

Llamo a la función resizePicture() cuando el usuario se desplaza.

Entonces, si tiene alguna idea de cómo podría optimizar esto o hacerlo de una manera diferente, simplemente no quiero este retraso.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda