Ecommerce Shopify WordPress Discussion

Blinked image when cursor enter in the image

(English) I am making a simple zoom effect when the cursor moves over the image, the only problem I have is that when the cursor enters the image it starts to blink. This is in a shopify store, I don't have access to the img tag, only can work with classes. I try to change the transform origin and add a backface but the problem persist. (Español) Estoy haciendo un efecto de zoom sencillo cuando se desplace el cursor sobre la imagen, el unico inconveniente que tengo es que cuando el cursor va entrando a la imagen este empieza a parpadear. function habilitarZoom() { const imagenes = document.getElementsByClassName('rimage__image'); for (let i = 0; i < imagenes.length; i++) { const imagen = imagenes[i]; const contenedor = imagen.parentNode; contenedor.addEventListener('mousemove', function(event) { const contenedorRect = contenedor.getBoundingClientRect(); const imagenRect = imagen.getBoundingClientRect(); const offsetX = (event.clientX - contenedorRect.left) / contenedorRect.width; const offsetY = (event.clientY - contenedorRect.top) / contenedorRect.height; const translateX = (imagenRect.width - contenedorRect.width) * offsetX; const translateY = (imagenRect.height - contenedorRect.height) * offsetY; imagen.style.transformOrigin = `${offsetX * 50}% ${offsetY * 50}%`; imagen.style.transform = `scale(2.5) translate(${-translateX}px, ${-translateY}px)`; }); contenedor.addEventListener('mouseout', function() { imagen.style.transformOrigin = 'center center'; imagen.style.transform = 'scale(1) translate(0, 0)'; }); } } document.addEventListener('DOMContentLoaded', function() { habilitarZoom(); }); .rimage__image { transition: transform 3s ease; } .rimage__image:hover { transform: scale(2.5); } .rimage-wrapper { overflow: hidden; }
TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.