You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using offcanvas to show a menu on mobile devices, the a href links inside of a dropdown-menu are not working. While other a href links not inside of a dropdown-menu are working fine.
Any ideas on how to make the a href links inside of the dropdown-menu work?
I'm using the latest bootstrap.bundle.js and bootstrap.css.
See my code here:
Also using this extra js file to make the menu work:
// http://bootstrap-menu.com$(document).ready(function(){/// Prevent closing from click inside dropdown$(document).on('click','.dropdown-menu',function(e){e.stopPropagation();});// refresh window on resize$(window).on('resize',function(){location.reload();});if($(window).width()<992){$('.has-megasubmenu a').click(function(e){e.preventDefault();$(this).next('.megasubmenu').toggle();$('.dropdown').on('hide.bs.dropdown',function(){$(this).find('.megasubmenu').hide();})});$('.dropdown-menu a').click(function(e){e.preventDefault();if($(this).next('.submenu').length){$(this).next('.submenu').toggle();}$('.dropdown').on('hide.bs.dropdown',function(){$(this).find('.submenu').hide();})});}/// offcanvas onmobile$("[data-trigger]").on("click",function(e){e.preventDefault();e.stopPropagation();varoffcanvas_id=$(this).attr('data-trigger');$(offcanvas_id).toggleClass("show");$('body').toggleClass("offcanvas-active");$(".screen-overlay").toggleClass("show");});/// Close menu when pressing ESC$(document).on('keydown',function(event){if(event.keyCode===27){$(".mobile-offcanvas").removeClass("show");$("body").removeClass("overlay-active");}});$(".btn-close, .screen-overlay").click(function(e){$(".screen-overlay").removeClass("show");$(".mobile-offcanvas").removeClass("show");$("body").removeClass("offcanvas-active");});});// document ready //end
The text was updated successfully, but these errors were encountered:
When using offcanvas to show a menu on mobile devices, the a href links inside of a dropdown-menu are not working. While other a href links not inside of a dropdown-menu are working fine.
Any ideas on how to make the a href links inside of the dropdown-menu work?
I'm using the latest bootstrap.bundle.js and bootstrap.css.
See my code here:
Also using this extra js file to make the menu work:
The text was updated successfully, but these errors were encountered: