要登錄一個向左滑動,即可使用
$('.image').on('swipeleft', function (e) {
console.log('swipeleft');
});
右
$('.image').on('swiperight', function (e) {
console.log('swiperight');
});
這個地方在你的代碼的功能$(document).on('pageinit', function() {}
。
這些事件可以延長,這是對這些事件
$ .event.special.swipe.handleSwipe默認:
function(start, stop) {
if (stop.time - start.time < $.event.special.swipe.durationThreshold &&
Math.abs(start.coords[ 0 ] - stop.coords[ 0 ]) > $.event.special.swipe.horizontalDistanceThreshold &&
Math.abs(start.coords[ 1 ] - stop.coords[ 1 ]) < $.event.special.swipe.verticalDistanceThreshold) {
start.origin.trigger("swipe")
.trigger(start.coords[0] > stop.coords[ 0 ] ? "swipeleft" : "swiperight");
}
}
如何將這樣做是否有助於解決我的問題? – 2619 2013-02-28 09:10:44
對不起,剛更新了答案 – 2013-02-28 09:16:15
這有幫助嗎?你是否希望擴展默認事件? – 2013-02-28 10:34:07