jQuery的touchstart,touchmove,touchend的获取位置

      $('#webchat_scroller').on('touchstart',function(e) {

      var touch = e.originalEvent.targetTouches[0]; 

      var y = touch.pageY;

      });


      $('#webchat_scroller').on('touchmove',function(e) {

      var touch = e.originalEvent.targetTouches[0]; 

      var y = touch.pageY;

      });

     $('#webchat_scroller').on('touchend',function(e) {

       var touch = e.originalEvent.changedTouches[0]; 

      var y = touch.pageY;

   });




关注微信公众号:前端开发知识

jQuery的touchstart,touchmove,touchend的获取位置_第1张图片


你可能感兴趣的:(js)