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

111
Vistas
Reset position of HTML element in Javascript

I am changing the absolute position of an Image element with Javascript by adding following CSS class via classList.add(".moving"):

.moving {
    position: absolute;
    display: inline-block;
}

When a certain event occurs, I would like that img to go back in its previous (standard flow) place inside a div container. I've already removed the .moving class and also set the position and display properties back to relative and inline manually.

pic.classList.remove(".moving");
puzzleSource.style = "position: relative; display: inline";

Somehow I can't wrap my head around this. Hope one of you guys can help me out.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I feel so dumb now - I formatted the div container

puzzleSource.style = "position: relative; display: inline";

instead of the pic.

Sorry for bothering! It works now.

about 4 years ago · Juan Pablo Isaza Denunciar
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