js 获取 touch length

window.addEventListener("touchstart", touchHandler, false);
function touchHandler(event){
    if(event.touches.length > 1){
        //the event is multi-touch
        //you can then prevent the behavior
        event.preventDefault();
    }
}

 

posted @ 2017-08-03 15:51  echolife  阅读(383)  评论(0编辑  收藏  举报