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

113
Views
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 answers
Answer question

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