标签:
这里只写了几个点击事件,就单击,双击,两只手指同时放在屏幕上( 一般是放大缩小等事件,需要自行构建内容 )
var which; var isPress = 0; var main = document.getElementById(‘main‘); //这边自己改自己的地址就行 main.ontouchstart = function (event) { event.preventDefault(); var e = window.event || event; if( isPress == 0 ) { isPress = 1; which = ‘singleFinger‘; } else { if (e.touches[1]) { which = ‘doubleFinger‘; }else{ which = ‘doubleClick‘; }; }; setTimeout( yanChi , 500 ); }; function yanChi() { isPress = 0; console.log(which); };
标签:
原文地址:http://www.cnblogs.com/neuscx/p/5048725.html