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.
Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024Digital marketers and app developers have tracked activity in apps and websites for yea...
By Ollie Mar 13, 2024February was an exciting month with Shopify Editions, informative webinars, and more! F...
By JasonH Mar 7, 2024