我有一个简单的矩形锚标签。click
我使用 jQuery来响应touchstart
以下事件:
$(document).ready(function() {
$("#button").on("click touchstart", function(e) {
$("#log").append(e.type + "<br/>");
});
});
HTML 如下所示:
<div id="wrapper">
<a id="button" href="#"> </a>
</div>
<div id="log">Log:<br></div>
CSS 很简单:
#wrapper {
padding:50px;
}
#button {
display:block;
width:200px;
height:40px;
text-decoration:none;
color:#333;
background-color:#efefef;
border:0px;
padding:0px;
margin:0px;
}
当您点击矩形锚点的边缘时,只会click
触发事件。当您点击该区域的中心时,两者都会click
被touchstart
射击。
为什么它click
似乎只通过胖手指检测触发?有没有办法让这个touchstart
事件也适用于胖手指?