1

我已经实现了 touchevents,它唤起了与我的鼠标事件相同的功能:

onclick -> touchstart {做某事}

mousemover -> touchmove { 做某事 }

mouseup -> touchend { 做某事 }

一切正常,touchend但未触发。

document.body.addEventListener('touchstart', start);
function start(e){ do something ; touchDefaults(e); }

document.body.addEventListener('touchmove', move );
function move(e){ do something ; touchDefaults(e); }

document.body.addEventListener('touchend', end );
function end(e){ do something ; touchDefaults(e); }

document.body.addEventListener('touchcancel', cancel );
function cancel(e){ touchDefaults(e); }

document.body.addEventListener('touchleave', leave );
function leave(e){ touchDefaults(e); }
4

0 回答 0