Home>Support>Solution to Making the Parent Menu Item Clickable to Toggle Submenu Items

Solution to Making the Parent Menu Item Clickable to Toggle Submenu Items

By goog-F, 6 years ago. Last reply by Alex S, 6 years ago.

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!

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 6 years, 9 months ago Alex S
    Hi, I Work Here

    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.

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More