Hide Offcanvas Menu - Question | JoomShaper
Black Friday sale is live with flat 50% OFF. Sale ends soon! Grab your deal now!

Hide Offcanvas Menu

KN

Karl Napf

Helix Framework 2 years ago

How can I hide the offcanvas menu after click on anchor link? The customer wants it to dissapear after click.

Thx

0
1 Answers
Paul Frankowski
Paul Frankowski
Accepted Answer
Senior Staff 2 years ago #107123

Hi Karl,

from Helix settings you cannot - it request extra custom JavaScript. We had few topics about that, and one of users shared below two tips:

1st:

// Offcanvas hack for one page website
var nav_collapse = $('.offcanvas-menu .menu');
nav_collapse.click('li a', function(event) {
       event.preventDefault();
    $('.offcanvas-init').removeClass('offcanvas-active');
});

2nd: For us, the single line at the end of main.js now works:

jQuery('.offcanvas-menu .menu').click(function(){jQuery('.close-offcanvas').trigger('click')});

I only shared, no support.

0