js的touchstart没有触发

JavaScript014

js的touchstart没有触发,第1张

js的touchstart没有触发,可以在touchstart的时候调用下event.preventDefault(),即可让其他事件都正常被触发了。js的左右上下滑动触屏事件,主要有三个事件:touchstart,touchmove,touchend。

html页面里写:

<body id="home" ontouchstart="touchStart()" ontouchmove="touchMove()" ontouchend="touchEnd()">

js里边写:

function touchStart(){

event

}

function touchMove(){

event

}

function touchEnd(){

event

}