single product images cause cumulative layout shift
-
Hi – it tested with google pagespeed insights and gtmetrix. They both indicate a cumulative layout shift(CLS) for single product images.
I tried a css and jquery solution.
In my stylesheet i assigned:/.woocommerce-product-gallery__image{ visibility: hidden; }
and then when the document has fully loaded $(document).ready:
$('.woocommerce-product-gallery__image').css({'visibility':'visible'});
but that did not help.Then i altered product-image.php by removing the opacity transition on line 40.
The image was first shown for a split second and then faded in again.
There must be some script that fades in the image. But where? jquery.flexslider.js?
That also didn’t bear the desired result.Finally i disabled loading lazy in my functions.php, but also with this step, no improvement.
I wonder if other woocommerce users have encountered the same behaviour concerning CLS for single product images?
Has anyone found a workaround in order to improve this web vital?
Thanks for your interest.
regards
theoThe page I need help with: [log in to see the link]
- The topic ‘single product images cause cumulative layout shift’ is closed to new replies.