Title: Hover effect stops working after a while
Last modified: December 9, 2019

---

# Hover effect stops working after a while

 *  [Onur Kurtic](https://wordpress.org/support/users/onurkurtic/)
 * (@onurkurtic)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/hover-effect-stops-working-after-a-while/)
 * Hi there
 * I am hoping that someone’s had this issue before and can help us. The hover effect
   on the top level menu items stops working after a while on our page. It happens
   for instance when you search (CTRL + F) for a word on the page or manually resize
   the browser. After this the hover stops working and the only way to reveal the
   mega menu sub items is to click on the chevrons.
 * Anyone have an idea why this is happening and how to fix it?

Viewing 9 replies - 1 through 9 (of 9 total)

 *  Plugin Author [megamenu](https://wordpress.org/support/users/megamenu/)
 * (@megamenu)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/hover-effect-stops-working-after-a-while/#post-12222896)
 * Hi onurkurtic,
 * Please can you post a link to your site so I can take a look?
 * Do you see any JavaScript errors in the console after resizing your browser?
 * Regards,
    Tom
 *  Thread Starter [Onur Kurtic](https://wordpress.org/support/users/onurkurtic/)
 * (@onurkurtic)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/hover-effect-stops-working-after-a-while/#post-12223607)
 * [https://ivaripublic.staging.wpengine.com](https://ivaripublic.staging.wpengine.com)
 *  Plugin Author [megamenu](https://wordpress.org/support/users/megamenu/)
 * (@megamenu)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/hover-effect-stops-working-after-a-while/#post-12223919)
 * Hi onurkurtic,
 * Thanks.
 * The issue is in this file somewhere:
 * [https://ivaripublic.staging.wpengine.com/wp-content/themes/ivari/js/custom.js?ver=1575908678](https://ivaripublic.staging.wpengine.com/wp-content/themes/ivari/js/custom.js?ver=1575908678)
 * … possibly in the “create_hooks_large” or “destroy_hooks_mobile” function. Please
   try commenting those out to try and work out exactly where the issue is coming
   from.
 * The actual issue is that the parent items should be/are given a class of “mega-
   toggle-on” when you over over a menu item. But when you resize the screen, the
   parent items are given a class of “active” instead, which shouldn’t happen.
 * Regards,
    Tom
 *  Thread Starter [Onur Kurtic](https://wordpress.org/support/users/onurkurtic/)
 * (@onurkurtic)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/hover-effect-stops-working-after-a-while/#post-12224048)
 * Thank you! It looks like it may have been the `destroy_hooks_large()` function
   inside the big `create_hooks_large()` function that was causing it. When I comment
   out `destroy_hooks_large()` it seems to fix the issue. I hope it doesn’t break
   anything else
 *  Plugin Author [megamenu](https://wordpress.org/support/users/megamenu/)
 * (@megamenu)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/hover-effect-stops-working-after-a-while/#post-12224112)
 * Hi onurjurtic,
 * The only problem you will have is that if the theme updates then you will need
   to reapply that edit each time.
 * I can see now where the destroy_hooks_large() function is being applied to the
   menu now. It is adding itself to “.main-menu li”, and “main-menu” is present 
   on the menu here:
 * [https://screencast.com/t/XdQo5Z87](https://screencast.com/t/XdQo5Z87)
 * That class is being added by this (custom?) JavaScript:
 * [https://screencast.com/t/leT7WbYy](https://screencast.com/t/leT7WbYy)
 * … so if you remove that line of JavaScript, I think it may all start working 
   as it should.
 * Regards,
    Tom
 *  Thread Starter [Onur Kurtic](https://wordpress.org/support/users/onurkurtic/)
 * (@onurkurtic)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/hover-effect-stops-working-after-a-while/#post-12228753)
 * Similar to this problem, on the mobile menu (when visiting the site on an iPhone
   for instance) tapping on a menu item expands it no problem. However when you 
   try to tap on it again, it won’t collapse. You need to tap on the tiny little
   chevron icon on the right hand side.
 * Do you know why this is ?
 *  Plugin Author [megamenu](https://wordpress.org/support/users/megamenu/)
 * (@megamenu)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/hover-effect-stops-working-after-a-while/#post-12230512)
 * Hi onurjurtic,
 * Please go to Mega Menu > Menu Themes > General Settings and set Second Click 
   Behaviour to “First click opens sub menu, second click closes sub menu”.
 * Regards,
    Tom
 *  Thread Starter [Onur Kurtic](https://wordpress.org/support/users/onurkurtic/)
 * (@onurkurtic)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/hover-effect-stops-working-after-a-while/#post-12232381)
 * Amazing thanks a lot!
    Last question (I promise :)) on iPhone landscape orientation
   and on iPad portrait layout, the 3 column layout under “about ivari” is tacking
   into 1 column. How do I adjust the break points for that so that it doesn’t stack
   until iPhone portrait?
 *  Plugin Author [megamenu](https://wordpress.org/support/users/megamenu/)
 * (@megamenu)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/hover-effect-stops-working-after-a-while/#post-12234972)
 * Hi onurkurtic,
 * The menu is picking up some CSS from your theme. To fix it, try this custom CSS:
 *     ```
       #mega-menu-wrap-consumer_main_menu li {
           clear: none;
       }
       ```
   
 * Regards,
    Tom

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Hover effect stops working after a while’ is closed to new replies.

 * ![](https://ps.w.org/megamenu/assets/icon-128x128.png?rev=1489843)
 * [Max Mega Menu](https://wordpress.org/plugins/megamenu/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/megamenu/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/megamenu/)
 * [Active Topics](https://wordpress.org/support/plugin/megamenu/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/megamenu/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/megamenu/reviews/)

## Tags

 * [hover](https://wordpress.org/support/topic-tag/hover/)

 * 9 replies
 * 2 participants
 * Last reply from: [megamenu](https://wordpress.org/support/users/megamenu/)
 * Last activity: [6 years, 5 months ago](https://wordpress.org/support/topic/hover-effect-stops-working-after-a-while/#post-12234972)
 * Status: not resolved