WooCommerce native product gallery doesn’t show when using scripts delay
-
Hi, I’ve tried many workarounds and it seems I’ve found something.
It seems the native WooCommerce product gallery has set opacity to 0 until the scripts relevant to render it run, then it fadesIn. When I use scripts delay via your plugin, the gallery is not visible until someone interacts with the website. This is not expected and I’ve found that WP Rocket has a built-in solution.
I’ve tried to force opacity 1 to the gallery, but it looks bad, since the JS responsible for putting the html together and make a flexslider out of it is being delayed.
I’ve tried to exclude relevant scripts from being delayed, but it seems now they run too quick, so the slider doesn’t work either.
I’ve found that in WP Rocket they keep these 2 scripts from being delayed but keep the defer tag and it runs well this way.
I’m not sure this is the 100% fix for this problem, because I’m not able to test it. I don’t know how to exclude certains scripts from being delayed, but keep the defer tag present.
The relevant scripts to the gallery are:
/plugins/woocommerce/assets/js/frontend/single-product.min.js
/plugins/woocommerce/assets/js/flexslider/jquery.flexslider.min.jsPlease help ??
The page I need help with: [log in to see the link]
- The topic ‘WooCommerce native product gallery doesn’t show when using scripts delay’ is closed to new replies.