This thread is over two years old and may be outdated. Please create a new thread if you need help, or email us if you have an active Premium license.

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

8 years ago · Last reply by Alex S 8 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.

Need fast email support? Get SiteOrigin Premium

Replies

1
  1. Alex S Staff 8 years, 2 months ago

    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.

Have a different question or issue?

Start New Thread