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.
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.