对于使用jQuery touchwipe的某些擦拭,默认擦拭。

| 我正在使用这个很棒的插件来捕获移动设备上的擦除事件:http://www.netcu.de/jquery-touchwipe-iphone-ipad-library 我正在使用该页面源代码中的代码来使我的图片库按原样循环。但是,我的图片库是屏幕的整个宽度。不幸的是,touchwipe似乎阻止了默认的擦拭纸上下滚动页面。除了指定其他行为外,是否有办法使其使用默认行为?
$(document).ready(function() {
    $(\'#imagegallery\').cycle({
        timeout: 0,
        fx: \'scrollHorz\',
        next: \'#next\',
        prev: \'#prev\' 
    });

    $(\"#imagegallery\").touchwipe({
        wipeLeft: function() {
            $(\"#imagegallery\").cycle(\"next\");
        },
        wipeRight: function() {
            $(\"#imagegallery\").cycle(\"prev\");
        }
    });
});
我也愿意接受其他替代方法来达到同样的效果(其他插件,其他方法)。谢谢!     
已邀请:
        在jquery.touchwipe库的这个小补丁中:
if(Math.abs(dx) >= config.min_move_x) {
     cancelTouch();
     if(dx > 0) {
-        config.wipeLeft();
+        config.wipeLeft(e);
     }
     else {
-        config.wipeRight();
+        config.wipeRight(e);
     }
  }
  else if(Math.abs(dy) >= config.min_move_y) {
     cancelTouch();
     if(dy > 0) {
-        config.wipeDown();
+        config.wipeDown(e);
     }
     else {
-        config.wipeUp();
+        config.wipeUp(e);
     }
  }
然后,您可以更改代码以选择性地调用e.preventDefault():
$(document).ready(function() {
    $(\'#imagegallery\').cycle({
        timeout: 0,
        fx: \'scrollHorz\',
        next: \'#next\',
        prev: \'#prev\' 
    });

    $(\"#imagegallery\").touchwipe({
        wipeLeft: function(e) {
            e.preventDefault();
            $(\"#imagegallery\").cycle(\"next\");
        },
        wipeRight: function(e) {
            e.preventDefault();
            $(\"#imagegallery\").cycle(\"prev\");
        },
        preventDefaultEvents: false
    });
});
(我已将补丁提交给插件作者。)     
        我找到了一个暂时有效的临时答案,可在以下位置找到:http://plugins.jquery.com/content/vertical-scroll 最好得到一个更好的答案。     

要回复问题请先登录注册