このコードは、指のスワイプジェスチャで正常に機能しています。つまり、指をスワイプすると、イベントが発生し、nextMonth() 関数が呼び出されます。2 つの異なるジェスチャで 2 つの異なるメソッドを呼び出すことができるように、上方向と下方向にスワイプしたかどうかを確認できる方法があります。
var myGesture = new MSGesture();
var v = this.element.querySelector(".bartouch");
myGesture.target = v;
v.addEventListener("MSGestureEnd", handleListner,false);
v.addEventListener("MSPointerDown", handleListner, false);
function handleListner(evt) {
if (evt.type == "MSPointerDown")
{
myGesture.addPointer(evt.pointerId);
return;
}
that.nextMonth();
}