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
User | RANK |
---|---|
44 | |
42 | |
42 | |
28 | |
21 |
On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023You've downloaded the Search & Discovery app from the Shopify App store, and as you're ...
By Skye Nov 8, 2023The year-end shopping season is just around the corner. Is a flash sale on your radar? Are...
By Jasonh Nov 6, 2023