If in the off-canvas menu exists a tags that are targeting an element from the same page and you click on them, the off-canvas menu will remain open after click. In the following lines of code I will put a way that will make off-canvas to close after click.
-
In the html page you have to insert the following attributes on a tags: data-scroll="true" and data-id="#something" like this: <a href="" data-scroll="true" data-id="#something"></a> for properly working javascript functions from the step 2. Then you must put an id="something" attribute on you're targeted element for example <div id="something"></div>.
-
You need to go in assets/js/ct-paper.js on line 100 and put the following code:
$('a[data-scroll="true"]').click(function(e){
var scroll_target = $(this).data('id');
var scroll_trigger = $(this).data('scroll');
if(scroll_trigger == true && scroll_target !== undefined){
e.preventDefault();
$('html, body').animate({
scrollTop: $(scroll_target).offset().top - 50
}, 1000);
}
});
$('.navbar-collapse a[data-scroll="true"]').click(function(){
setTimeout(function(){
if(gsdk.misc.navbar_menu_visible == 1) {
$('html').removeClass('nav-open');
gsdk.misc.navbar_menu_visible = 0;
$('#bodyClick').remove();
setTimeout(function(){
$toggle.removeClass('toggled');
}, 550);
}
}, 550);
});
If in the off-canvas menu exists
atags that are targeting an element from the same page and you click on them, the off-canvas menu will remain open after click. In the following lines of code I will put a way that will make off-canvas to close after click.In the html page you have to insert the following attributes on
atags:data-scroll="true"anddata-id="#something"like this:<a href="" data-scroll="true" data-id="#something"></a>for properly working javascript functions from the step 2. Then you must put anid="something"attribute on you're targeted element for example<div id="something"></div>.You need to go in
assets/js/ct-paper.json line 100 and put the following code: