解决方案 »

  1.   

    你搞错名字了吧。你那是哪个版本的jquery mobile啊,我看了下源码,里面设置水平方法滑动距离的不是你说的这个名字啊$.event.special.swipe.horizontalDistanceThreshold
    好像是这个啊。版本:jQuery Mobile 1.4.2你自己在源码里面,直接搜索这个:horizontalDistanceThreshold,看有没有。
    没有就找$.event.special.swipe这个对象在哪里。
      

  2.   

    抱歉,您说的对,是我写错了,不过代码里是对的,是您写的这行代码,
    在页面里我是这么写的<script src="js/jquery.js"></script>
    <script src="js/jquery.mobile-1.4.2.min.js"></script>
    <script>
        $(document).bind('mobileinit', function(){
                $.event.special.swipe.horizontalDistanceThreshold(40);
        })
    alert($.event.special.swipe.horizontalDistanceThreshold)
    </script>
    <script>
    $(function() {
        $("#id").swipeself()
    });
      

  3.   

    这个是一个属性,不是一个方法,直接赋值就好了。$.event.special.swipe.horizontalDistanceThreshold = 40;