1
次のコードがあります。スワイプイベント内でthis.swipeメソッドを呼び出そうとしていますが、これはどのような機能をトリガします。これは、this.crowusel.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