📌  相关文章
📜  [违规] 向滚动阻塞添加了非被动事件侦听器<some>事件.考虑将事件处理程序标记为“被动”以使页面更具响应性.看<URL>[违规] &#39;setTimeout&#39; 处理程序耗时 59 毫秒 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:53.649000             🧑  作者: Mango

代码示例1
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') });
    }
};