我的代碼工作正常,用於手指輕掃手勢,即如果我用手指輕掃,它會觸發事件並調用nextMonth()函數。現在有什麼方法可以檢查我是否向上和向下滑動,以便在兩種不同的手勢上調用兩種不同的方法。MsGesture,在城市風格的應用程序中向不同方向滑動
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();
}
您的球八個示例鏈接不起作用。是否有更新鏈接或指向另一個示例的鏈接,以顯示您在2中概述的行爲? –