Sub menu not showing on hover or click

Hi @Nabeel,

Thanks a lot for this piece of code. Its exactly what i’m looking for.

I tried it and it worked great the first time I open the sub menu and dismiss it on my Tablet.

After that, trying to open the submenu wouldn’t work. It just wouldnt open.

Looking forward for a solution for this.

Thanks again.

You’re welcome.

@christian_y
Please read my previous message.

Thanks

Hi again,

The above solution will close the submenu only when you click somewhere else in the body, however if you need to close the menu by clicking on menu item itself then you can use this code:

jQuery(document).ready(function($){
	$('.menu-item-has-children').on('touchend', function(e) {
		if($(this).hasClass('x-active')) {
			$(this).removeClass('x-active');
		}
		else {
			$(this).addClass('x-active');
		}
	});
});

Don’t forget to clear your browser’s cache after adding the code. Let us know how this goes!

Hi again @Nabeel

Thanks for your reply but again, this is not what I asked.
Im not sure what is happening, but Ive been getting random responses not related to questions Im asking.

let me clarify again:

The solution you provided me has a BUG. It does not work properly.

Here’s how to replicate the bug:
When I open the sub menu, and then close it, and then try to reopen it AGAIN, it will not open again (tablet only)

Please try this yourself:
Open the sub menu, close the submenu, then try to open the sub menu again. It will not work.

Looking forward for a solution.

Thanks in advance

Hi there,

Then what you’re currently referring is the desktop menu. You don’t need any fixes or CSS for that case since your menu should work like that. Tapping outside will serve as mouse-hover-out, I thought you’re referring to the mobile menu which can be open only by toggling its sub-menu. Try removing those CSS and Javascript and test it again, open a sub-menu and click on the menu and it will close. Else, please provide a video recording again without these fixes.

Thanks!

Hi @Rad

Yes, I am reffering to the desktop menu when used on Tablet touch screen.

If I remove the code, the submenu will never close. (check video attached that shows behaviour without the code)

The Code provided above allows me to close the submenu when i scroll or press on the menu button. BUT it will not allow me to open the submenu again. It just allows me to open it once. Which is a problem.

Please i need a fix for that.

Thanks

Hello There,

Could you please disable Optimize Press plugin? It might be causing this issue because we have tested the theme in different browsers and on the tablet and we could not replicate the issue. This could be caused by a 3rd party plugin. You could try testing for a plugin conflict. You can do this by deactivating all third party plugins, and seeing if the problem remains. If it’s fixed, you’ll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time.

If the issue still exist, please re install X theme and Cornerstone. There might be some files that were corrupted. You can review our update guide and see the Manual Update section to re install X.

Please let us know how it goes.

Hi @RueNel
I deactivated ALL plugins and Submenu functionality still not working on tablet like it should be working based on demos.

I deleted the Theme and Reinstalled it but issue still persists.

Please let me know how to fix this.

Thanks

Okay, after thorough testing, i figured out that the style sheet had this code that was causing the issue:

.touchevents .x-navbar {
overflow:hidden;
-webkit-overflow-scrolling:touch;
}

Things worked perfectly after removing it.

Thanks for the help.

Glad to hear it and thanks for letting us know!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.