I'm currently working on an admin dashboard and I want the sidebar to remain collapsed even when transitioning from one page to another. Initially, I prefer it to be expanded but after clicking the hamburger toggle button, it collapses. However, I don't want it to expand again when redirecting to a new page.
Is there a way to keep it collapsed after redirection?
You can view my code snippet here: https://jsfiddle.net/jgh2cnsa/
$(document).ready(function(){
$('.hamburger').on('click',function(){
$('#side-bar').toggleClass("side-bar-toggle");
$('.menu-container ul').toggleClass('menu-container-toggle');
$('.side-text').toggleClass('side-text-toggle');
$('.fa-angle-right').toggleClass('fa-angle-right-toggle');
$('.menu-container ul li a').toggleClass('menu-container-ul-ul-i-a-toggle');
$('#right-section').toggleClass('right-section-toggle');
$('#nav').toggleClass('nav-toggle');
$('.container').toggleClass('container-toggle');
});
});
To see the result, click here:- https://jsfiddle.net/jgh2cnsa/