Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
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.
In Canada, payment processors, like those that provide payment processing services t...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025