嗨,我的 chrome 在 document.documentElement 上显示"ontouchstart">是真的,而它是 thinkpad t440p,而不是移动设备,反映了引导下拉列表插入带有类下拉列表背景的div
如果你
使用'ontouchstart' in document.documentElement
它应该可以在Chrome中正常工作。(我昨天刚刚使用它,它正确地为 Chrome 返回了 false。
请注意,in
是一个JavaScript运算符,但"on"肯定不是!我很确定这就是问题所在。