0

我正在使用 Touchswipe 触发基于向右滑动和向左滑动的事件。经过大量测试,我发现 touchswipe 不适用于 android 股票浏览器,因为 touchswipe 没有在股票浏览器上触发滑动事件。有什么解决方法吗?

触发代码:

  $(function() {      

  //Enable swiping...
  $("#content").swipe( {
    //Generic swipe handler for all directions
    swipe:function(event, direction, distance, duration, fingerCount) {
      if(direction == "left"){

      }else if(direction == "right"){

      }else if(direction == "down"){
        // event.preventDefault()
      }
    },
     threshold:0
  });
});
4

2 回答 2

0

您是否尝试过使用 jQuery mobile 来支持滑动功能。此处提供了开发人员 API 。

这里的区别在于,$(document).ready(function() ...)我们可以调用而不是调用:$(document).bind('pageinit')

于 2013-09-19T08:59:49.497 回答
0

好吧,在遇到很多问题后,我发现无法使用外部 Js 文件中的代码触发 android STOCK 浏览器上的滑动事件,但如果放在同一个 html 文件上则可以。奇怪但有效。

于 2013-09-19T08:59:29.277 回答