モバイル側タッチイベントの概要
1484 ワード
oBox.ontouchendにe.changedTouchesイベントが入っているのは、ブラウザに、さっき誰がここにいたのかを伝えるためです.多分そういう意味です.
1.touches現在画面上にあるすべての指のリスト2.targetTouches現在のDOM要素上にある指のリスト3.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{width: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>