Online store performance and site speed optimization
Hello,
I'm trying to add the passive flag that is missing according to GTMetrix. The inspector tells me line 897, and am viewing it in the Sources tab, but I'm not sure exactly how to implement it.
I tried adding it to my theme.js, but nothing seems to be working here either. My site is https://www.killyourgod.ai
The line specified by Lighthouse is:
<body class="template-index" ontouchstart="return true;" data-transitions="true" data-animate_underlines="true" data-animate_images="true" data-button_style="shadow" data-type_product_capitalize="true" data-type_header_capitalize="true" data-product_image_scatter="false" data-button_type_style="caps">
The code that I assume I would edit in the theme.js is:
// Prevent vertical scroll while using flickity sliders
(function() {
var e = !1;
var t;
document.body.addEventListener('touchstart', function(i) {
if (!i.target.closest('.flickity-slider')) {
return e = !1;
void 0;
}
e = !0;
t = {
x: i.touches[0].pageX,
y: i.touches[0].pageY
}
})
document.body.addEventListener('touchmove', function(i) {
if (e && i.cancelable) {
var n = {
x: i.touches[0].pageX - t.x,
y: i.touches[0].pageY - t.y
};
Math.abs(n.x) > Flickity.defaults.dragThreshold && i.preventDefault()
}
}, { passive: !1 })
})();
Can anyone assist?
I still need assistance with this, if anyone can help. Thank you.
Make the shift from discounts to donations, and witness your business not only thrive fina...
By Holly Dec 4, 2023On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023You've downloaded the Search & Discovery app from the Shopify App store, and as you're ...
By Skye Nov 8, 2023