zoukankan      html  css  js  c++  java
  • 移动端触摸事件简介

    oBox.ontouchend里面放e.changedTouches事件是为了告诉浏览器,刚才谁在这里了,大概是这么个意思。

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

    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>无标题文档</title>
    <meta name="viewport" content="width=device-width,target-densitydpi=device-dpi,user-scalable=no">
    <style>
    div{100px;height:100px;background:Red;}
    </style>
    </head>
    <body>
    <div id="box"></div>
    <script>
    var oBox=document.getElementById("box");
    oBox.ontouchstart=function(e)
    {
        //console.log(e.touches);
    };
    oBox.ontouchmove=function()
    {
        //console.log(e.touches);
    };
    oBox.ontouchend=function(e)
    {
        console.log(e.changedTouches);
    };
    </script>
    </body>
    </html>
  • 相关阅读:
    hdu3487 Play with Chain
    poj3481
    [HNOI2002]营业额统计
    poj3468 A Simple Problem with Integers
    [NOI2004]郁闷的出纳员
    UVa1308 LA2572
    20130620
    poj3580
    20130618
    C++类模版学习笔记
  • 原文地址:https://www.cnblogs.com/masita/p/4492360.html
Copyright © 2011-2022 走看看