The Mega Menu module constantly creates the "Unable to get property 'top' of undefined or null reference" error as a user scrolls through the page. I traced it down to a problem in the awemenu.min.js file. Its a bit hard to parse since its minimized, but here is what I think that the issue is:
In the minimized file there is this line:
h=isNaN(parseInt(this.options.stickyOffset))?b(this.options.stickyOffset).offset().top+b(this.options.stickyOffset).height():parseInt(this.options.stickyOffset)
The error is in trying to get .top off the offset for this.options.stickyOffset. For whatever reason, this is undefined here. If add &&this.lenght>0 to the condition then all is well. its difficult to tell what should be going on there, but since I'm not using the menu in sticky mode, I wonder if there is some check that is missing and its getting into a bit of code it shouldn't
The error wasn't breaking anything, it was just anoying to see in the console.
For anyone who wants it, find the code above in awemenu.min.js and change it to this:
h=isNaN(parseInt(this.options.stickyOffset))&&this.length>0?b(this.options.stickyOffset).offset().top+b(this.options.stickyOffset).height():parseInt(this.options.stickyOffset)
Hi,
Thank you for your feedback. It will help our team and other customers so much.
If there is any problem when using our mega menu in the future, please feel free to contact us.
Thanks for the hint. It has helped me. No more error messages !! thank you