var nav_collapse = $('.offcanvas-menu .menu.nav');
nav_collapse.click('li a', function(event) {
event.preventDefault();
$('.offcanvas-init').removeClass('offcanvas-active');
});
Hi,
Try this code
var nav_collapse = $('.offcanvas-menu .menu.nav');
nav_collapse.click('li a', function(event) {
event.preventDefault();
$('.offcanvas-init').removeClass('offcanvas-active');
});
Thanks
Arun
Hi,
Try this code
var nav_collapse = $('.offcanvas-menu .menu.nav');
nav_collapse.click('li a', function(event) {
event.preventDefault();
$('.offcanvas-init').removeClass('offcanvas-active');
});
Thanks
Arun
I've tried putting this code in the JS main and it does not work. Am i placing it in the right place.
Hi,
Try this code
var nav_collapse = $('.offcanvas-menu .menu.nav');
nav_collapse.click('li a', function(event) {
event.preventDefault();
$('.offcanvas-init').removeClass('offcanvas-active');
});
Thanks
Arun
I've tried putting this code in the JS main and it does not work. Am i placing it in the right place.
Please share your URL. In my website, it is working perfectly.
Is there some News concerning this issue?
Best Regards
Hi,
Try this code
var nav_collapse = $('.offcanvas-menu .menu.nav');
nav_collapse.click('li a', function(event) {
event.preventDefault();
$('.offcanvas-init').removeClass('offcanvas-active');
});
Thanks
Arun
I've tried putting this code in the JS main and it does not work. Am i placing it in the right place.
Please share your URL. In my website, it is working perfectly.
http://ashleighandbryan.savethisdate.co.za/
$('.offcanvas-init').removeClass('offcanvas-active');
$('.off-canvas-menu-init').removeClass('offcanvas');
Hi,
Try this code
var nav_collapse = $('.offcanvas-menu .menu.nav');
nav_collapse.click('li a', function(event) {
event.preventDefault();
$('.offcanvas-init').removeClass('offcanvas-active');
});
Thanks
Arun
I've tried putting this code in the JS main and it does not work. Am i placing it in the right place.
Please share your URL. In my website, it is working perfectly.
http://ashleighandbryan.savethisdate.co.za/
Not sure, if you've already found the fix.
but I was going through same and below is the fix that worked for me.
In the above JS code Replace
$('.offcanvas-init').removeClass('offcanvas-active');
with
$('.off-canvas-menu-init').removeClass('offcanvas');
Still not working for me.![]()
var nav_collapse = $('.offcanvas-menu .menu.nav');
nav_collapse.click('li a', function(event) {
event.preventDefault();
$('.offcanvas-init').removeClass('offcanvas-active');
});
Bhavin, Thanks for your engeneering an the solution for Helix Ultimate. I'm using the joomshaper Rental-Template under the following url: https://erpel.polarwolf.li/
I'm not able to find a solution myself for this problem. Can you please help me? I will pay for your work, if you can show me the right way.
// Smooth scrolling for # link with anchor name
$("a[href^='#']").on('click', function(e) {
// prevent default anchor click behavior
e.preventDefault();
// animate
$('html, body').animate({
scrollTop: $(this.hash).offset().top
}, 1000, function(){
});
});
$("a[href^='#about']").on('click', function(e) {
// prevent default anchor click behavior
e.preventDefault();
// animate
$('html, body').animate({
scrollTop: $(this.hash).offset().top
}, 1000, function(){
});
});
// 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');
});
Bhavin, Thanks for your engeneering an the solution for Helix Ultimate. I'm using the joomshaper Rental-Template under the following url: https://erpel.polarwolf.li/
I'm not able to find a solution myself for this problem. Can you please help me? I will pay for your work, if you can show me the right way.
Hi Brinkley,
I see that your menu structure is missing "nav" element. So add the below code at the end of the main.js file. In your case it is located https://erpel.polarwolf.li/templates/erpel.ch/js/main.js
I've also added #links with smooth scrolling![]()
I solved the problem with a workaround of duplicating my Main Menu and changing the url paths to http://sitename.com/index.php/#sectionid. Then my off-canvas menu I used the duplicated menu for. The smooth-scroll is lost on mobile but the functionality to close the off-canvas works that way. The "http://sitename.com" is only an example and can be left out of the URL if desired.Thank you - yes, I have ended up doing this as well - much appreciated
Hi,
Try this code
var nav_collapse = $('.offcanvas-menu .menu.nav');
nav_collapse.click('li a', function(event) {
event.preventDefault();
$('.offcanvas-init').removeClass('offcanvas-active');
});
Thanks
Arun
I've tried putting this code in the JS main and it does not work. Am i placing it in the right place.
Please share your URL. In my website, it is working perfectly.
http://ashleighandbryan.savethisdate.co.za/
Not sure, if you've already found the fix.
but I was going through same and below is the fix that worked for me.
In the above JS code Replace
$('.offcanvas-init').removeClass('offcanvas-active');
with
$('.off-canvas-menu-init').removeClass('offcanvas');
Hi,
Try this code
var nav_collapse = $('.offcanvas-menu .menu.nav');
nav_collapse.click('li a', function(event) {
event.preventDefault();
$('.offcanvas-init').removeClass('offcanvas-active');
});
Thanks
Arun
I've tried putting this code in the JS main and it does not work. Am i placing it in the right place.
Please share your URL. In my website, it is working perfectly.
http://ashleighandbryan.savethisdate.co.za/
Not sure, if you've already found the fix.
but I was going through same and below is the fix that worked for me.
In the above JS code Replace
$('.offcanvas-init').removeClass('offcanvas-active');
with
$('.off-canvas-menu-init').removeClass('offcanvas');
Thank you Bhavin. It works. but there's another problem now:
The link to a new SP Page Builder page no longer works. Clicking on it closes the menu but it does not jump to the page.
Can you help me?
Best regards
var nav_collapse = $('.offcanvas-menu .menu.nav');
nav_collapse.click('li a', function(event) {
event.preventDefault();
$('.offcanvas-init').removeClass('offcanvas-active');
});
$('.close-offcanvas, .offcanvas-overlay').on('click', function (event) {
event.preventDefault();
$('.offcanvas-init').removeClass('offcanvas-active');
});
$('a.smoothscroll, .offcanvas-overlay').on('click', function (event) {
event.preventDefault();
$('body').removeClass('offcanvas-active');
});
<li class="item-186"><a href="#ref" class="smoothscroll">ScrollTo</a></li>
jQuery(function ($) {
// Offcanvs
$('a.smoothscroll, .offcanvas-overlay').on('click', function (event) {
event.preventDefault();
$('body').removeClass('offcanvas-active');
});
});