Creating a toggle funtion on desktop navbar menu item
Hi
I am currently trying to create a clickable menu item. The menu item has a dropdown mega menu.
I want the dropdown menu to only display and hide when it is clicked, not when hovered over with the mouse.
The menu item is called "meny" and has a hamburger icon next to it :)
Here's the code I've made so far, but it's not working:
<script>
jQuery(document).ready(function(){
jQuery(".et_fullwidth_nav #top-menu li.mega-menu > ul").click(function(){
jQuery("this").toggle();
});
</script>
using wordpress 4.6.1
I am new to jQuery and would love some help.. Thank you