Dear Kriesi/Enfold Support Team,
I would like to show all unordered list elements below my header’s menu at once when a user mouses over it. More precisely, I want to change my .sub-menu ul-s’ opacity to 1 and visibility to ‘visible’ when a user mouses over the header div (.avia-menu .av-main-nav-wrap).
In theory, I understand how to do this with jquery/javascript, but where can I add this bit of code in the Theme Editor? Or what’s the best approach to implement what I am seeking to do?
Many thanks in advance,
Fabian
Hey fabian_stricker,
Thank you for the inquiry.
You can create an external js script and register using the wp_enqueue_script function, or add an inline script using the wp_add_inline_script function. You can also use the wp_head or wp_footer to insert script inside the head tag or before the closing body tag. Whichever way you choose should be fine.
inline script: https://developer.wordpress.org/reference/functions/wp_add_inline_script/
external js: https://developer.wordpress.org/reference/functions/wp_enqueue_script/
You can also add the script directly in the template files but we recommended doing one of the above methods.
Best regards,
Ismael