var ele = document.getElementsByClassName('target_node_class')[0] //may have x and y properties in some browsers,But it always has left, top, right, and bottom properties. var rect = ele.getBoundingClientRect(); var touch = new Touch({ "identifier&qu…
js的touch事件,一般用于移动端的触屏滑动$(function(){document.addEventListener("touchmove", _touch, false);}) function _touch(event){alert(1);}touchstart:当手指触摸屏幕时触发:即使已经有一个手指放在了屏幕上也会触发.touchmove:当手指在屏幕上滑动时连续的触发.在这个事件发生期间,调用preventDefault()可阻止滚动.touchend:当手指从屏幕上移…
function _tap(dom,callBack){ var startTime=0; var delayTime=200; var isMove=false; dom.addEventListener("touchstart",function(e){ startTime=Date.now(); }); dom.addEventListener("touchmove",function(e){ if(isMove==false){ isMove=true; }…