在使用Google Pagespeed优化网站时,我遇到了一个问题,该问题
导致页面解释您需要在鼠标滚轮滚动事件和触摸事件中使用被动模式。
document.addEventListener('touchstart', onTouchStart, {passive: true});
我在网站上使用jquery.ui.touch-punch.js库,但我不知道将属性放在哪里passive: true
在使用Google Pagespeed优化网站时,我遇到了一个问题,该问题
导致页面解释您需要在鼠标滚轮滚动事件和触摸事件中使用被动模式。
document.addEventListener('touchstart', onTouchStart, {passive: true});
我在网站上使用jquery.ui.touch-punch.js库,但我不知道将属性放在哪里passive: true
WordPress 的代码在这里有所帮助。