Console: .andSelf() is not a function
-
When hovering over a menu item on our homepage (nwhospital.org) the menu would not drop down and an error in the console was recorded:
TypeError: anchor.parent(...).siblings(...).find(...).andSelf is not a function[from line 93 of maxmegamenu.js].After investigating, I changed the deprecated .andSelf to .addBack in maxmegamenu.js. Now the dropdown is working on hover.
Curiously, the menu was working on every page but the home page with the .andSelf reference. After changing the reference all pages continue to function.
Now, I notice when moving the mouse away from the menu item, the closing of the dropdown is not instant. First you see the background color of the menu item go back to normal, and then the dropdown menu closes. I haven’t ever paid close enough attention to know if it has always functioned this way.
Here’s a dump from the console when loading the homepage with the .andSelf reference included. It may be worth noting we’re using the standard WP jQuery implementation: jQuery v1.12.3 and JQMIGRATE v1.4.0
TypeError: anchor.parent(...).siblings(...).find(...).andSelf is not a function $.maxmegamenu/plugin.hideSiblingPanels() maxmegamenu.js:93 $.maxmegamenu/plugin.showPanel() maxmegamenu.js:129 $.maxmegamenu/openOnHover/<.over() maxmegamenu.js:229 a.fn.hoverIntent/k() hoverIntent.min.js:1 a.fn.hoverIntent/k/c.hoverIntent_t<() hoverIntent.min.js:1
The topic ‘Console: .andSelf() is not a function’ is closed to new replies.