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

105
Views
Eliminar/Agregar clase en el menú flotante

He intentado muchas formas de simplemente hacer que una clase cambie en una imagen cuando paso el mouse sobre un elemento del menú y me está volviendo loco. Si alguien puede ayudarme a aclarar esto, agradecería un poco de ayuda... Al final tendré tres de estos en su lugar, uno para rojo, amarillo y azul... esto es lo que tengo como ejemplo...

 <script>
const triggerRed = document.getElementsByClassName('gardenBtn');
const redIMG = document.getElementById('gardenMe');
// 👇️ Change
triggerRed.addEventListener('mouseover', function handleMouseOver() {
 list = redIMG.classList;
 list.remove('risoMe');
});
// 👇️ Change back
triggerRed.addEventListener('mouseout', function handleMouseOut() {
 list = redIMG.classList;
 list.add('risoMe');
}); 
</script>

pero nada cambia

almost 4 years ago · Santiago Trujillo
1 answers
Answer question

0

No veo en ninguna parte que declares variable de list . De todos modos, si desea agregar una clase a ese elemento:

 list.classList.add('class-name');

si desea eliminar una clase:

 list.classList.remove('class-name');
almost 4 years ago · Santiago Trujillo 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!