All things Shopify and commerce
This is an accepted solution.
To create a custom hover effect for the menu in the Dawn theme, you'll need to modify the theme's code. Here's a general outline of the steps you can take:
To create a hover effect for the menu, you can use CSS selectors and properties to target the menu elements and define the desired styles. Here's an example of how you can create a simple hover effect:
/* Apply hover effect to menu items */
.site-nav__link:hover {
color: red; /* Change the text color on hover */
background-color: yellow; /* Change the background color on hover */
/* Add any other styles you want for the hover effect */
}
This is an accepted solution.
Hello There,
1. In your Shopify Admin go to online store > themes > actions > edit code
2. Find Layout -> theme.liquid and paste this at the bottom of the file:
<script>
let items = document.querySelector(".header__inline-menu").querySelectorAll("details");
console.log(items)
items.forEach(item => {
item.addEventListener("mouseover", () => {
item.setAttribute("open", true);
item.querySelector("ul").addEventListener("mouseleave", () => {
item.removeAttribute("open");
});
item.addEventListener("mouseleave", () => {
item.removeAttribute("open");
});
});
});
</script>
This is an accepted solution.
To create a custom hover effect for the menu in the Dawn theme, you'll need to modify the theme's code. Here's a general outline of the steps you can take:
To create a hover effect for the menu, you can use CSS selectors and properties to target the menu elements and define the desired styles. Here's an example of how you can create a simple hover effect:
/* Apply hover effect to menu items */
.site-nav__link:hover {
color: red; /* Change the text color on hover */
background-color: yellow; /* Change the background color on hover */
/* Add any other styles you want for the hover effect */
}
This is an accepted solution.
Hello There,
1. In your Shopify Admin go to online store > themes > actions > edit code
2. Find Layout -> theme.liquid and paste this at the bottom of the file:
<script>
let items = document.querySelector(".header__inline-menu").querySelectorAll("details");
console.log(items)
items.forEach(item => {
item.addEventListener("mouseover", () => {
item.setAttribute("open", true);
item.querySelector("ul").addEventListener("mouseleave", () => {
item.removeAttribute("open");
});
item.addEventListener("mouseleave", () => {
item.removeAttribute("open");
});
});
});
</script>
Thank you for your response. It's good to know that it's worked for you. Kindly feel free to get back to me if you need any further assistance.
If helpful then please Like and Accept Solution.
the hover works but as soon as I try to move the mouse it will close automatically which makes the hover menu not work
Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024In today’s interview, we sat down with @BSS-Commerce to discuss practical strategies f...
By JasonH Nov 13, 2024