zoukankan      html  css  js  c++  java
  • 移动端的touchstart,touchmove,touchend事件中的获取当前touch位置

    前提:touchstart,touchmove,touchend这三个事件可以通过原生和jq绑定。

    原生:document.querySelector("#aa").addEventListener('touchmove', function(){...});

    jq:  $(".aa").on("touchmove",function (e) {...};

    1.获取当前touch位置

     $('#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;

       });

  • 相关阅读:
    索引与完整性约束(note6)
    数据库查询语句(note4)
    select 查询(note3)
    数据库创建(note2)
    mysql(note1)
    day 05
    day 04 字符串
    博文索引
    ubuntu+xen的编译
    hexo+github搭建个人网站
  • 原文地址:https://www.cnblogs.com/chenguangliang/p/6636660.html
Copyright © 2011-2022 走看看