• Hi,

    Can someone help me add some code to my theme editor so that whenever someone clicks on the word “Illustration” in my side menu, it toggles the drop-down menu, basically giving the text the same function as the arrow icon next to it.

    Cheers
    Jacob

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Theme Author Anders Norén

    (@anlino)

    Hi @jacobmwolf,

    This jQuery should do it:

    $( '.menu-item-363 > .ancestor-wrapper > a' ).on( 'click', function() {
    	$( this ).siblings( '.sub-menu-toggle-wrapper' ).children( '.sub-menu-toggle' ).trigger( 'click' );
    	return false;
    } );

    You’ll need to add it to a .js file and enqueue it in a child theme, unless you can find a plugin that lets you add JavaScript to the site through an editor in the administration panel (sounds like something that should exist, but I don’t know of one off the top of my head).

    — Anders

Viewing 1 replies (of 1 total)

The topic ‘Make text toggle dropdown box in menu.’ is closed to new replies.