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

272
Views
Mousemove problem with classes. If i'm moving the mouse out content disappears

I have a problem with the menu. Can somebody check? If I'm moving the mouse out content disappears. I think there is no problem with classes.

class Menu{
    constructor(id){
        this.id = id;

        const linkBlock = document.querySelector(`.navigation__dropdown-block-${this.id}`);
        const menuLink = document.querySelector(`.navigation__link-${this.id}`);
        const menuLinks = document.querySelectorAll(`.navigation__link`);
        const linkBlockA = document.querySelectorAll('.navigation__dropdown-block--active')
         
        menuLink.addEventListener('mouseenter', () => {
            linkBlock.classList.add('navigation__dropdown-block--active');
            menuLink.classList.add('navigation__link--active');
        });
        linkBlock.addEventListener('mouseenter', () => {
            linkBlock.classList.add('navigation__dropdown-block--active');
            menuLink.classList.add('navigation__link--active');
        });
        menuLink.addEventListener('mouseleave', () => {
                linkBlock.classList.remove('navigation__dropdown-block--active');
                menuLink.classList.remove('navigation__link--active');
        });
        linkBlock.addEventListener('mouseleave', () => {
            linkBlock.classList.remove('navigation__dropdown-block--active');
            menuLink.classList.remove('navigation__link--active');
        });
    }
}

const menuLinks = document.querySelectorAll('.navigation__link');
for(let i = 0; i < menuLinks.length; i++){
    new Menu(i + 1);
}
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!