// This code needs to be added to the product details page code section
import { onMouseEnter, onMouseLeave } from 'wix-animations'; // Import animation functions
// Select the product image element using its ID (replace "your-image-id" with the actual ID)
const imageElement = document.getElementById('your-image-id');
// Define the zoom factor
const zoomFactor = 1.5; // Increase this value for a larger zoom effect
// Function to zoom in on hover
function zoomIn() {
imageElement.style.transform = `scale(${zoomFactor})`;
}
// Function to zoom out on mouse leave
function zoomOut() {
imageElement.style.transform = 'scale(1)';
}
// Add event listeners for hover and mouse leave
onMouseEnter(imageElement, zoomIn);
onMouseLeave(imageElement, zoomOut);