Lessons sidebar default state
Hi guys,
how can i set sidebar menu on lesson page to be closed by default its look nasty on small mobile screen
I didn't find any option for this in settings, so maybe I can add some 'code' in functions to get this to work? I tried to add a cookie you used for this, but its not working well can you provide any other working solution, please
Hi vitalie-work,
Default, the sidebar always display none on mobile. The devices screen smaller than 768px. Can you provide link your site, we'll check it.
Thanks.
Hi
i can't give you a link its not public with direct access in few words its like you need to enter through an iframe and in incognito 😄
and seems iframe is the case
even using JS on first load I need click twice to close menu
window.addEventListener('DOMContentLoaded', function () {
const menu = document.querySelector('#sidebar-toggle');
const cookieName = "LP";
const cookieValue = getCookieValue(cookieName);
const closeMenu = () => {
menu.click();
if(!menu.checked) setTimeout(() => menu.click(), 500);
}
if (cookieValue !== null) {
if (isJSONParsable(cookieValue)) {
const parsedValue = JSON.parse(cookieValue);
if( !parsedValue['sidebar-toggle'] ) {
closeMenu();
}
} else {
closeMenu();
}
} else {
closeMenu();
}
});