I’m having an issue with Shopify in Chrome - When I trigger an animation (GSAP or simple css), navigate to another page, and then return, the animation no longer runs. I’m using Chrome 142.0.7444.162 (latest)
Simple example:
test-section.liquid:
<p class="animate-gsap">Hello</p>
<div class="animate">World</div>
{% javascript %}
document.addEventListener('DOMContentLoaded', function() {
gsap.to(".animate-gsap", {
x: 300,
duration: 0.3,
ease: "power1.inOut"
});
});
document.addEventListener('DOMContentLoaded', function() {
const element = document.querySelector('.animate');
element.classList.add('move');
});
{% endjavascript %}
Is Shopify not compatible with Chrome’s back/forward cache (bfcache)?
