zoukankan      html  css  js  c++  java
  • 移动端 触摸事件 ontouchstart、ontouchmove、ontouchend、ontouchcancel

    1、Touch事件简介
    pc上的web页面鼠 标会产生onmousedown、onmouseup、onmouseout、onmouseover、onmousemove的事件,但是在移动终端如 iphone、ipod  Touch、ipad上的web页面触屏时会产生ontouchstart、ontouchmove、ontouchend、ontouchcancel 事件,分别对应了触屏开始、拖拽及完成触屏事件和取消。
    当按下手指时,触发ontouchstart;
    当移动手指时,触发ontouchmove;
    当移走手指时,触发ontouchend。
    当一些更高级别的事件发生的时候(如电话接入或者弹出信息)会取消当前的touch操作,即触发ontouchcancel。一般会在ontouchcancel时暂停游戏、存档等操作。
     
    2、Touch事件与Mouse事件的出发关系
    在触屏操作后,手指提起的一刹那(即发生ontouchend后),系统会判断接收到事件的element的内容是否被改变,如果内容被改变,接下来的事 件都不会触发,如果没有改变,会按照mousedown,mouseup,click的顺序触发事件。特别需要提到的是,只有再触发一个触屏事件时,才会 触发上一个事件的mouseout事件。
  • 相关阅读:
    洛谷 1341 无序字母对
    POJ 2774 后缀数组 || 二分+哈希
    HDU 1251 统计难题
    【解题报告】AtCoder ABC115 (附英文题目)
    【模板】后缀数组
    洛谷 3567/BZOJ 3524 Couriers
    Beta 冲刺 (1/7)
    团队项目评测
    beta冲刺前准备
    Alpha冲刺——事后诸葛亮
  • 原文地址:https://www.cnblogs.com/furenjian/p/5421868.html
Copyright © 2011-2022 走看看