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

93
Views
Si desenfoco una imagen, la siguiente también se desenfoca cuando busco otras nuevas

Cuando cargo una imagen borrosa con el botón 3, puedo desenfocarla con el botón 1 después. Pero cuando vuelvo a hacer clic en el botón 3 para cargar la siguiente imagen, permanece sin desenfoque en lugar de una siguiente imagen borrosa...

CSS:

 .show3 { filter: blur(8px); } .show2 { transition-duration: 5s; filter: none !important; }

JavaScript:

 let element2 = document.getElementById("button3"); element2.addEventListener("click", () => { let cat_result = document.getElementById("cat_result"); fetch('https://aws.random.cat/meow') .then(res => res.json()) .then(data => { cat_result.innerHTML = `<img src="${data.file}"/>` }) cat_result.classList.toggle("show3"); }); let element1 = document.getElementById("button1"); element1.addEventListener("click", () => { let cat_result = document.getElementById("cat_result"); cat_result.classList.toggle("show2"); });
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Debe eliminar "show2" cuando haga clic en el primer botón y cambiarlo para que, en lugar de usar alternar, use agregar y eliminar.

 let element2 = document.getElementById("button3"); element2.addEventListener("click", () => { let cat_result = document.getElementById("cat_result"); cat_result.classList.remove("show2"); cat_result.classList.add('show3'); fetch('https://aws.random.cat/meow') .then(res => res.json()) .then(data => { cat_result.innerHTML = `<img src="${data.file}"/>` }) }); let element1 = document.getElementById("button1"); element1.addEventListener("click", () => { let cat_result = document.getElementById("cat_result"); cat_result.classList.add("show2"); cat_result.classList.remove('show3'); });
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!