Is it possible to adjust multicolumn images which don’t feature products to have a hover/scroll over effect that shows a secondary image (in the same way products do)
Thanks
Is it possible to adjust multicolumn images which don’t feature products to have a hover/scroll over effect that shows a secondary image (in the same way products do)
Thanks
Hey @HomeSickTreats
Yes, it is possible to add a hover or scroll over effect to multicolumn images that don’t feature products. You can achieve this effect using CSS and JavaScript. Here’s a general approach:
.image-container {
position: relative;
}
.secondary-image {
position: absolute;
top: 0;
left: 0;
display: none; /* or opacity: 0; */
}
const imageContainers = document.querySelectorAll('.image-container');
imageContainers.forEach((container) => {
const secondaryImage = container.querySelector('.secondary-image');
container.addEventListener('mouseenter', () => {
secondaryImage.style.display = 'block'; // or secondaryImage.style.opacity = 1;
});
container.addEventListener('mouseleave', () => {
secondaryImage.style.display = 'none'; // or secondaryImage.style.opacity = 0;
});
});
Remember to adjust the class names and modify the CSS and JavaScript code to fit your specific HTML structure and styling preferences. Additionally, you may need to consider responsiveness and adapt the code accordingly for different screen sizes or devices.
If I managed to help you then, don’t forget to Like it and Mark it as Solution!
Best Regards,
Moeed
Hi there,
Firstly thank you so much for taking the time to post all of this! I really appreciate it.
For JS/CSS and HTML text would I need to post this via a custom liquid section or within the code of the store. I seem to find most of the store assets are in liquid and I’m not sure where I would input this JS/HTML/CSS script