var startX = startY = endX = endY = 0;
var dom = document.getElementById('main');
//touchStart事件
dom.addEventListener('touchstart',function(event){
var touch = event.targetTouches[0];
startX = touch.pageX;
startY = touch.pageY;
document.getElementById('start').value = startX + ',' + startY;
},false);
//touchmove事件
dom.addEventListener('touchmove',function(event){
var touch = event.targetTouches[0];
endX = touch.pageX;
endY = touch.pageY;
},false);
//touchend事件
dom.addEventListener('touchend',function(event){
document.getElementById('end').value = endX + ',' + endY;
document.getElementById('count').value = (endX - startX) + ',' + (endY - startY);
},false);