Shopify themes, liquid, logos, and UX
I want to change my main menu to open when I hover over the title & keep opened when my mouse is still on the header. Once mouse leaves the header section, the menu will close.
My website: https://kindred-haus.com/
PW: KHaus2023
Basically, I want the menu to function like this website: https://mogutable.com/
Thank you!
Hi @kindred-haus,
To switch the mega menu in Shopify's Craft theme from click to mouseover, modify the theme's JavaScript. Replace the click event with a mouseenter event, and possibly add a mouseleave event to close the menu. Here's a sample code snippet:
$(document).ready(function() {
$('.mega-menu-trigger').off('click').on('mouseenter', function() {
$(this).find('.mega-menu-content').show();
});
$('.mega-menu-trigger').on('mouseleave', function() {
$(this).find('.mega-menu-content').hide();
});
});
Replace .mega-menu-trigger and .mega-menu-content with the actual selectors used in your theme.
Hi @KabirDev ,
I don't have much coding experience, is it possible for you to be a little more specific/provide step by step instructions.
Thank you so much, really appreciate it!
Is your problem solved? If not I can provide a solution. Please let me know.
Best regards
Shishir Hasan | Shopify Website Developer
Update, I was able to create the mouse over action to access the drop down menu with another code I found through the community. But it's difficult to access the sub menu when I move my mouse over since the menu is left aligned. Once I move my mouse to the sub menu, the menu closes.
Sorry another update, I was able to solve this! Now, is it possible to change
1. hover on sub menu, instead of it being an underline change to bold
2. move submenu text to align with menu header
Thank you!
Okay, Good to hear.
If you need any kind of help, will do just a knock. I'm able for Shopify design, development, and funnel building.
Best regards
Shishir Hasan | Shopify Website Developer
By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024