0

我有不适用于 android 平板电脑的图像滑块代码。但在添加以下行后,它也开始在 android 上工作。

$('#myImageFlow ').on("click touchstart",".sliderImage",touchStart());
function touchStart(event){
  };

但这给出了错误::

Uncaught TypeError: Object .sliderImage has no method 'apply',

touchstart() 我不需要但是,而不是如果我给出 false 则我的滑块无法在 android 上运行。

4

1 回答 1

4

您需要将函数引用作为回调传递,而不是touchStart方法返回的值。

$('#myImageFlow ').on("click touchstart", ".sliderImage", touchStart);
function touchStart(event){
};
于 2013-06-14T07:43:52.623 回答