移动端click会遇到2个问题,click会有200-300ms的延迟,同时click事件的延迟响应,会出现穿透,即点击会触发非当前层的点击事件. 为什么会存在延迟? Google开发者文档中有提到: mobile browsers will wait approximately 300ms from the time that you tap the button to fire the click event. The reason for this is that the browser…
document.onclick = function (e) { var e = e ? e : window.event; var tar = e.srcElement || e.target; if (tar.id != "searchData") { pagesZone.style.display = "none"; } } 以上代码在电脑浏览器和安卓上都能触发alert事件,但是在iOS上却完全没有反应. 如果这个name标签是button的可click事…