Jquery mobile $.event.special.swipe.horizontalDistanceThreshold在每次滑动中仅返回其默认值(30px)

Jquery mobile $.event.special.swipe.horizontalDistanceThreshold在每次滑动中仅返回其默认值(30px),jquery-mobile,swipe,image-gallery,Jquery Mobile,Swipe,Image Gallery,我试图在jquery mobile中找到滑动的水平距离。在每次交换中,它仅返回其默认值30。 我试过以下方法: $('.ad-thumb-list').on("swipeleft swiperight",function(event){ //alert("swipe"); if(event.type == 'swipeleft'){ // alert("left"); alert($.event.special.swipe.hor

我试图在jquery mobile中找到滑动的水平距离。在每次交换中,它仅返回其默认值30。 我试过以下方法:

 $('.ad-thumb-list').on("swipeleft swiperight",function(event){
   //alert("swipe");
        if(event.type == 'swipeleft'){
        // alert("left");

            alert($.event.special.swipe.horizontalDistanceThreshold); //i expect the different threshold values in different swipe..
            galleries[0].nextImage();
        }
        else if(event.type == 'swiperight'){
            //alert("right");
            galleries[0].prevImage();
        }
});

另外,我正在使用AD gallery插件。

通过设置自己的HandleSweep功能,您可以获得开始和停止对象,从而实际获得滑动距离和时间。在你对它们做了你需要的任何事情之后,你将决定是否触发一次刷卡。这只不过是挂在墙上


30px是用户触发刷卡事件应通过的最小水平距离,因此它始终是固定的。使用触摸事件来计算距离。先生,请您详细说明一下好吗?我试着轻拍,轻拍。但是我还是没有得到结果。我不确定JQM是否有内置的方式来显示你刷了多少像素,你可能需要一个替代方法-@Tasos我已经尝试过这个插件。我面临一些点击不兼容的问题,我回到jquery移动刷事件。不过,谢谢你的建议。你说得对,我刚刚测试了这个——但它也不起作用。我来看看是否能找到JQM方法
    $.event.special.swipe.handleSwipe = function( start, stop ) {
        $("#about-delta-x").html("delta-x: " + (stop.coords[0]-start.coords[0]).toString());
        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" );
        }
    };