Hello. Could someone have a look at the layout why the menu is blinking: the address http://activities.ursmu.ru/ , when you hover over the "SPIRITUAL AND MORAL EDUCATION" item, a pop-up menu appears and it blinks constantly. All styles shoveled, I can not understand: why is it blinking?

Closed due to the fact that off-topic participants Grundy , HamSter , Kirill Stoianov , Bald , tutankhamun 4 Oct '16 at 7:27 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • “Questions asking for help with debugging (“ why does this code not work? ”) Should include the desired behavior, a specific problem or error, and a minimum code for playing it right in the question . Questions without an explicit description of the problem are useless for other visitors. See How to create minimal, self-sufficient and reproducible example . " - Grundy, HamSter, Kirill Stoianov, Bald, tutankhamun
If the question can be reformulated according to the rules set out in the certificate , edit it .

  • the minimum reproducible example should be in question. Links can only be a supplement - Grundy
  • Google Chrome, and also does not blink - Ksenia
  • Chrome Windows blinks, it's impossible to even click. - Stanislav Khatsko
  • Add directly to the question, markup, styles, and possibly js-scripts if they are used - Grundy
  • I blink when I move the cursor on the pop-up submenu. This may be the case if, for example, a guidance condition is prescribed for both opening and closing this menu - then it will open when you hover and immediately close and immediately open and ... - lexxl

2 answers 2

The problem, due to which the drop-down menu blinks, is the following: the drop-down menu is not nested in the main menu (in the html structure)

You have registered a mousemove event on the main menu item, and while the mouse moves within it, an additional menu is displayed. However, as soon as you hover the mouse over the drop-down menu (look at the picture and see the intersection of both menus), the mousemove event ends and the additional menu is hidden (since the mouse is no longer within the main menu). After this event is triggered again (because the additional menu is already hidden and you are still in the intersection area) and the situation repeats.

enter image description here

  • Then why is it working here as it should: edu.ursmu.ru - Stanislav Khatsko
  • one
    It works there because the developer uses the class active to track the menu, which is added to both the main menu and the drop-down menu when hovering. If you copy someone's code, then you should fully understand how it works. In general, a terrible implementation with a bunch of events and all sorts of classes, instead of using the banal :hover . - Andrew B
  • I took all the code from there and still blinks. - Stanislav Khatsko
  • Open the console (F12 in Google Chrome), open the Elements tab and find your menu in the code. Drive through it and see that the class .active not added. Do the same for the site where it works, and see that there this class is added when you hover. This means that you did not copy everything correctly. - Andrew B

Because you have a <div class="foold"> tag outside the <a> tag and put it inside the <a href="http://fane.ursmu.ru">Духовно-нравственное воспитание</a> tag tag <a href="http://fane.ursmu.ru">Духовно-нравственное воспитание</a> Or better use the list <ul>

  • Then why does edu.ursmu.ru work here normally? Everything is taken from there. - Stanislav Khatsko
  • one
    Probably because js-ohm adds a class .active and a menu and a link. - HamSter