1
我有下面的代碼,我試圖在刷卡事件中調用this.swipe它觸發任何函數的方法。問題是它不知道這是什麼.swipe在上下文this.carousel.swipe。我怎樣才能觸發這個功能?深入到事件以外的方法
PM.SwipeCarousel = function (carouselSelector) {
this.carousel = $j(carouselSelector);
this.carousel.swipe({
swipe : this.swipe
})
// method to call
this.swipe = function(event, direction, distance, duration, fingerCount, fingerData) {
console.log(event, direction, distance, duration, fingerCount, fingerData);
}
}
你試圖通過該方法已創建它。 – Bergi