jQuery to override non-clickable Menu item with Sub Menu
A simple and easy code to override bootstrap default behavior of making links non-clickable if that Menu item has a sub menu.
jQuery(“.deeper.parent a”).each(function(i, obj){
jQuery(this).click(function(){
var url = jQuery(this).attr(“href”);
jQuery(location).attr(‘href’, url);
});
});
Are you having website issues, At IDL Web Inc., we provide reliable website design services in Canada for businesses and individuals. Connect with us today.
jQuery to override non-clickable Menu item with Sub Menu Overview
Experience any WordPress Issues?
Frequently Asked Questions
Our support team ready to help you, please contact with them
How to make a top level menu item not clickable in WordPress?
Few possible methods to fix this menu issue:
- Remove the link: simply delete the URL associated with the menu item in the Appearance > Menus settings.
- Use a custom class: add a custom class to the menu item and use CSS to remove the href attribute or style it to appear as a non-clickable element.
- Use a custom plugin: some plugins offer specific features to control menu item behaviour, including making them non-clickable.
Why is the dropdown-menu not toggling when clicking on?
Possible reasons for the dropdown-menu issues:
- Missing or incorrect JavaScript.
- Incorrect HTML structure.
- Conflicting styles.
- JavaScript interference.
