I am using hammer for dragging and it is getting choppy when loading other stuff, as this warning message is telling me.
(我正在使用锤子进行拖动,在加载其他东西时它变得不稳,因为此警告消息告诉我。)
Handling of 'touchstart' input event was delayed for X ms due to main thread being busy.
(由于主线程繁忙,“ touchstart”输入事件的处理延迟了X ms。)
Consider marking event handler as 'passive' to make the page more responsive.(考虑将事件处理程序标记为“被动”,以使页面更具响应性。)
So I tried to add 'passive' to the listener like so
(所以我试图像这样向听众添加“被动”)
Hammer(element[0]).on("touchstart", function(ev) {
// stuff
}, {
passive: true
});
but I'm still getting this warning.
(但我仍然收到此警告。)
ask by Matt translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…