Answer the question
In order to leave comments, you need to log in
Why are touchstart, touchmove, touchend values shown relative to the viewport and not relative to the selected element?
var el = document.createElement("div");
el.addEventListener('touchmove', function(event){
if(event.targetTouches.length==1){
var touch = event.targetTouches[0];
console.log(touch.pageX+"px,"+touch.pageY+"px");
}
}, false);
el.textContent = " ";
el.style.height = 400+"px";
el.style.border = "1px solid red";
el.style.margin = 100+"px";
document.body.appendChild(el);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question