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

91
Views
Quiero cambiar la imagen 1 a la imagen 2 si se hace clic en ella y luego volver a la imagen 1 automáticamente después de 1 segundo

Cuando se hace clic en la imagen, quiero que cambie a otra imagen y que se coloque en la parte superior

Después de hacer clic y aparece la imagen 2, regresa a la imagen 1 y se empuja hacia abajo.

este es mi codigo hasta ahora

 function marioAnimation() { var i = true; var image = document.getElementById("mario1"); if (i) { document.getElementById("mario1").src = "/mario2.png"; image.style.marginTop = '10px'; var x = false; } else { document.getElementById("mario1").src = "/mario1.png"; } }
 <section id="section1"> <div class="container"> <img class="image" src="/mario1.png" alt="" id="mario1" onclick="marioAnimation()" style="margin-top: 50px;"> </div> </section>

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