All things Shopify and commerce
I am using the mode theme. I am trying to make the sub menu of the main menu pop up when I hover over it instead of having to click it. Please help with what code I need to add.
store link https://twisteraudio.com/
Hi,
You can try Custom css and for that first Identify the CSS Classes and at theme.scss.liquid or theme.css file or similar need to add CSS code and test
Code example for Hover Effect
/* Show sub-menu on hover */
.main-menu .has-sub-menu {
position: relative;
}
.main-menu .has-sub-menu:hover .sub-menu {
display: block;
opacity: 1;
visibility: visible;
}
.sub-menu {
display: none;
opacity: 0;
visibility: hidden;
position: absolute;
top: 100%; /* Adjust based on your menu design */
left: 0;
z-index: 9999;
background-color: #fff; /* Adjust as per your theme */
transition: opacity 0.3s ease;
}
/* Additional styling for smoother appearance */
.main-menu .sub-menu {
min-width: 200px; /* Adjust as necessary */
padding: 10px; /* Adjust as necessary */
}
Where exactly do I put this code? Im not that good at the coding aspect of shopify.
Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024The Hydrogen Visual Editor is now available to merchants in Shopify Editions | Summer '...
By JasonH Sep 2, 2024Note: Customizing your CSS requires some familiarity with CSS and HTML. Before you cust...
By JasonH Aug 12, 2024