diff --git a/snippets/shx-product-desc.liquid b/snippets/shx-product-desc.liquid index 53f818d..4667605 100644 --- a/snippets/shx-product-desc.liquid +++ b/snippets/shx-product-desc.liquid @@ -81,13 +81,22 @@ //animejs fade in //dom ready - if (document.getElementById('anime-script').readyState === 'complete' || document.getElementById('anime-script').readyState === 'loaded'){ - animate(); - } else { - document.getElementById('anime-script').addEventListener('load', function() { + if (document.readyState !== 'loading') { + + + if (document.getElementById('anime-script').readyState === 'complete' || document.getElementById('anime-script').readyState === 'loaded'){ + animate(); + } else { + document.getElementById('anime-script').addEventListener('load', function() { + animate(); + }); + } + + } else { + document.addEventListener('DOMContentLoaded', function() { animate(); }); - } + } } } }