对于移动端的触摸事件,我们通过touchstart、touchmove、touchend实现,PC端一般使用mousedown、mousemove、mouseup实现。

  我们获取事件坐标,原生js获取方式

mousedown event.pageX
mousemove event.pageX
mouseup event.pageX
touchstart event.touches[0].pageX  &  event.changedTouches[0].pageX  &  event.targetTouches[0].pageX
touchmove event.touches[0].pageX  &  event.changedTouches[0].pageX  &  event.targetTouches[0].pageX
touchend event.touches[0].pageX  &  event.changedTouches[0].pageX  &  event.targetTouches[0].pageX

  jQuery获取方式

mousedown event.pageX
mousemove event.pageX
mouseup event.pageX
touchstart event.originalEvent.touches[0].pageX  &  event.originalEvent.changedTouches[0].pageX  &  event.originalEvent.targetTouches[0].pageX
touchmove event.originalEvent.touches[0].pageX  &  event.originalEvent.changedTouches[0].pageX  &  event.originalEvent.targetTouches[0].pageX
touchend event.originalEvent.changedTouches[0].pageX  &  event.originalEvent.targetTouches[0].pageX

  其中关于touch触摸事件的触摸列表:

    touches :当前位于屏幕上的所有手指的一个列表。
    targetTouches :位于当前DOM元素上的手指的一个列表。
    changedTouches :涉及当前事件的手指的一个列表。

  对于jQuery中在移动端获取坐标使用的event.originalEvent,有以下:

  It's also important to note that the event object contains a property called originalEvent, which is the event object that the browser itself created. jQuery wraps this native event object with some useful methods and properties, but in some instances, you'll need to access the original event via event.originalEvent for instance. This is especially useful for touch events on mobile devices and tablets.

  event.originalEvent is usually just the native event (also described here).

  However, if the browser is compatible, and the event was a touch event then that API will be exposed through event.originalEvent.

  The short answer is that event.originalEvent is not always the same, it depends on which event type triggered the handler, and on the environment of the browser.

  关于event.originalEvent说明的地址链接:http://stackoverflow.com/questions/16674963/event-originalevent-jquery

  关于touch事件的补充内容地址链接:http://blog.csdn.net/clh604/article/details/9861411

移动端 touch 事件的originalEvent的更多相关文章

  1. H5案例分享:移动端touch事件判断滑屏手势的方向

    移动端touch事件判断滑屏手势的方向 方法一 当开始一个touchstart事件的时候,获取此刻手指的横坐标startX和纵坐标startY: 当触发touchmove事件时,在获取此时手指的横坐标 ...

  2. 原生js移动端touch事件实现上拉加载更多

    大家都知道jQuery里没有touch事件,所以在移动端使用原生js实现上拉加载效果还是很不错的,闲话不多说,代码如下: //获取要操作的元素 var objSection = document.ge ...

  3. 移动端touch事件影响click事件以及在touchmove添加preventDefault导致页面无法滚动的解决方法

    这两天自己在写一个手机网页,用到了触屏滑动的特效,就是往右滑动的时候左侧隐藏的菜单从左边划出来. 做完之后在手机原生浏览器中运行正常,但在QQ和微信中打开,发现touchmove只会触发一次,而且to ...

  4. 移动端Touch事件基础

    1.三个常用的移动端事件 ontouchstart 手指按下时触发 ontouchmove 手指移动时触发 ontouchend 手动抬起时触发 注意:这些事件当作事件属性使用时,不兼容谷歌浏览器. ...

  5. 移动端touch事件 || 上拉加载更多

    前言: 说多了都是泪,在进行项目开发时,在上拉加载更多实现分页效果的问题上,由于当时开发任务紧急,所以就百度找了各种移动端的上拉下拉 实现加载更多的插件.然后就留下了个坑:上拉加载的时候会由于用户错误 ...

  6. 移动端touch事件实现页面弹动--小插件

    动手之前的打盹 说实话真的是好久没有更新博客了,最近一直赶项目,身心疲惫:最关键的是晚上还要回去上一波王者,实在是忙啊! 这周下来,清闲了些许,或许是因为要到国庆的缘故吧,大家都显得无精打采.俗话说的 ...

  7. 移动端 Touch 事件

    在移动端页面开发时,常常会用到touch事件,比如左滑右滑的轮播等.常用的触摸事件有touchstart,touchmove,touchend. 每个事件包含下面三个用于跟踪虎摸的属性: touche ...

  8. 移动端touch事件封装

    <meta charset="utf-8"><meta name="viewport" content="width=device- ...

  9. 移动端--touch事件与点透问题

    也来说说touch事件与点击穿透问题: http://blog.csdn.net/alex8046/article/details/52299785

随机推荐

  1. linux安装jdk(以centos安装jdk1.7为例)

    1准备工作: 1 虚拟机一台vmware12,安装64位centos 2 oracle官网下载jdk1.7-linux-x64.rpm 3 winscp将jdk传送到linux上面 2开始安装: 1 ...

  2. Maven 导出依赖Jar,生成source.jar,javadoc.jar

    下载最新版的Maven http://maven.apache.org/download.cgi    解压到本地文件夹 新建环境变量    MAVEN_HOME   maven解压目录 在path加 ...

  3. LeetCode Reorder List

    struct ListNode { int val; ListNode *next; ListNode(int x) : val(x), next(NULL) {} }; class Solution ...

  4. System.arrayCopy()和普通数组复制之间的效率差别

    都是System.arrayCopy() 效率高,到底有多高呢,拉出来遛遛就知道了: package JCF.ArrayList; import java.util.Date; public clas ...

  5. 获取局域网中指定IP或是主机名称的所有文件夹及其搜索文件

    最近做个功能在局域网中所有指定文件,于是花了点精力完成了部分功能,先贴上 using System; using System.Collections.Generic; using System.Co ...

  6. UE4 UriEncode 问题

    当Uri 路径中带中文字符时,需要进行编码 否则会照成不可预见错误: FString temp = FGenericPlatformHttp::UrlEncode(queryStr); FString ...

  7. 感知机的对偶形式——python3实现

    运用对偶的(对应原始)感知机算法实现线性分类. 参考书目:<统计学习方法>(李航) 算法原理: 代码实现: 环境:win7 32bit + Anaconda3 +spyder 和原始算法的 ...

  8. runtime作用

    1.发送消息 方法调用的本质,就是让对象发送消息. objc_msgSend,只有对象才能发送消息,因此以objc开头. 使用消息机制前提,必须导入#import <objc/message.h ...

  9. centos 7 lamp (linux+apache+mysql+php)开发环境搭建(转+原创)

    准备篇:CentOS 7.0系统安装配置图解教程 http://www.jb51.net/os/188487.html 一.配置防火墙,开启80端口.3306端口 CentOS 7.0默认使用的是fi ...

  10. Keepalived双机热备

    一,Keepalived双机热备的应用场景 1,网站流量不高,压力不大,但是对服务器的可靠性要求极其高,例如实时在线OA系统,政府部门网站系统,医院实时报医系统,公安局在线报案系统,股市后台网站系统等 ...