Topic: SideNav fixed
Michal Szymanski staff pro premium priority answered 9 years ago
riderx pro answered 9 years ago
Michal Szymanski staff pro premium priority answered 9 years ago
riderx pro answered 9 years ago
if (menu_id.hasClass('fixed')) {
$(window).resize(function () {
if (window.innerWidth > 992) {
if (options.closeOnClick === true)
menu_id.off("click.itemclick", "a:not(.collapsible-header)");
// Close menu if window is resized bigger than 992 and user has fixed sidenav
if ($('#sidenav-overlay').css('opacity') !== 0 && menuOut) {
removeMenu(true);
} else {
menu_id.removeAttr('style');
menu_id.css('width', options.menuWidth);
}
} else if (menuOut === false) {
if (options.closeOnClick === true) {
menu_id.on("click.itemclick", "a:not(.collapsible-header)", function () {
removeMenu();
});
}
if (options.edge === 'left')
menu_id.css('left', -1 * (options.menuWidth + 10));
else
menu_id.css('right', -1 * (options.menuWidth + 10));
}
});
}
if closeOnClick, then add close event for all a tags in side sideNav
if (options.closeOnClick === true) {
if ((menu_id.hasClass('fixed') && window.innerWidth < 992) || !menu_id.hasClass('fixed')) {
menu_id.on("click.itemclick", "a:not(.collapsible-header)", function () {
removeMenu();
});
}
}
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
- User: Pro
- Premium support: No
- Technology: General Bootstrap questions
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No