Does not use passive listeners to improve scrolling performance

In order to resolve this issue from Google PageSpeed Insight report (fig.1)

Fig.1. "Does not use passive listeners" report.

Fig.1. “Does not use passive listeners” report.

please refer to Theme Options -> Advanced -> Custom JavaScript and add the following code there:

<script type="text/javascript">
jQuery.event.special.touchstart = {
    setup: function( _, ns, handle ) {
        this.addEventListener("touchstart", handle, { passive: !ns.includes("noPreventDefault") });
    }
};
jQuery.event.special.touchmove = {
    setup: function( _, ns, handle ) {
        this.addEventListener("touchmove", handle, { passive: !ns.includes("noPreventDefault") });
    }
};
jQuery.event.special.wheel = {
    setup: function( _, ns, handle ){
        this.addEventListener("wheel", handle, { passive: true });
    }
};
jQuery.event.special.mousewheel = {
    setup: function( _, ns, handle ){
        this.addEventListener("mousewheel", handle, { passive: true });
    }
};</script>

0