0
用於計算touchmove
事件之間的增量可能看起來像一個簡單的方法:Mobile Safari(iOS 9)Touch.clientX/Y在發送時沒有被實現嗎?
var lastEvent;
window.addEventListener('touchmove', function(event) {
if (lastEvent) {
console.log(event.touches[0].clientY - lastEvent.touches[0].clientY);
}
lastEvent = event;
});
在iOS 9,雖然,此增量是總是0對於連續touchmove
事件(夾在相同touchstart
和touchend
事件之間) 。
在iOS上10三角形的計算公式爲你所期望的。
我不明白爲什麼!