Hello, this is not a request for help. But I had a need to make the parent menu item clickable (and not just the little arrow to the right) in mobile view. I did a search for the solution in these forums but no solution turned up. Seems like many people had asked the same question for other themes. So I modified the included JS script for Unwind to do that. Hopefully, this will help others who are looking for the same thing.
You’ll have to check to see if your theme has similar code as Unwind. If using Unwind, open up js/unwind.js. Then find this code:
( '#mobile-navigation' ).on( 'click', '.dropdown-toggle', function( e ) { e.preventDefault(); $( this ).next( 'ul' ).slideToggle( '300ms' ); } );
Underneath it, insert the following code:
$( '#mobile-navigation' ).on( 'click', '.has-dropdown-button', function( e ) { e.preventDefault(); $( this ).next().next( 'ul' ).slideToggle( '300ms' ); } );
Then minify your JS script with some free javascript minifier. Upload, and voila.
I hope this helps someone else in the future!
Hi EF,
Thank you for this! :)
I’ve forwarded this to the development team and this should hopefully be fixed in the next update.
Please note that if this isn’t fixed in the name update you’ll need to reapply your fix as your change would have been lost in the update due to how WordPress handles updates.