Archived topic
What CSS + JavaScript is needed for the mobile menu
7 replies · Started by culpable on July 8, 2022
We're running some speed optimisations on the site and are having issues where these 3rd party speed optimisation services (via Ezoic) seem to break the functionality of the GP mobile menu.
No need to help me troubleshoot this directly. I'd just like to know what CSS & JS files are associated/needed for the mobile menu to function correctly.
We'll exclude these files from the optimisation.
So far we have the JavaScript shown here.
Thank you very much for your help.
Hi there,
for the default GP Mobile menu - its just these files:
generatepress/assets/js/menu.min.js
generatepress/assets/css/main.min.css
Hey David,
Fantastic, thank you for sending those files through.
Does that mean that the code shown here https://i.imgur.com/A0nUhvq.png\
Is contained within the generatepress/assets/js/menu.min.js code?
Kinda. That code is declaring the various Javascript Variables ( whats inside that curly brackets ) that GP uses in its menu.min.js script. Presumably so the Exoic optimizer can ignore the elements those variables are attached to.
Makes sense David.
My hunch is that this inline JS was being delayed via the Ezoic code and hence this script generatepress/assets/js/menu.min.js couldn't function properly. And that would break the mobile menu functionality?
(I say that because until we excluded said inline JS from the Ezoic optimiser, the mobile menu would not open or close when clicked).
Yeah most probably, optimisers that defer and combine scripts risk breaking there functionality.
Glad to hear thats working for you
Righto, makes sense.
Thank you very much for your help David. Always a pleasure :)
You're welcome!