Site logo

Archived topic

Off-Canvas Panel closes after click in a menu item

1 reply · Started by jose on December 16, 2020

Viewing posts 1–2 of 2

When I click in a menu item inside off-canvas,
Off canvas just close the menu so fast and after load the new url.
How can i stop closing ooff canvas menu til url changes?

Hi there,

It does this to allow for anchors on the page.

However, you can tell it not to with some javascript.

var slideoutLinks = document.querySelectorAll( '.slideout-navigation ul a' );

for ( var i = 0; i < slideoutLinks.length; i++ ) {
	slideoutLinks[ i ].removeEventListener( 'click', 'closeOffsideOnAction', false );
};

Let me know if you need more info :)

This archived topic is closed to new replies.