jQuery Ui Touch-无法阻止被动侦听器中的Default

时间:2019-06-24 10:37:47

标签: jquery jquery-ui jquery-mobile jquery-plugins

我已经下载了jquery.ui.touch.js,以使QapTcha滚动条在移动网站上滑动。我怎么一直收到以下错误“ [干预]由于目标被视为被动,无法在被动事件侦听器中阻止Default”

我在以下功能上收到此错误:

    function iPadTouchHandler(event) {
            var type = "",
      button = 0; /*left*/

if (event.touches.length > 1)
    return;

switch (event.type) {
    case "touchstart":
        if ($(event.changedTouches[0].target).is("select")) {
            return;
        }
        iPadTouchStart(event); /*We need to trigger two events here to support one touch drag and drop*/
        event.preventDefault(); // this is where it breaks
        return false;
        break;

    case "touchmove":
        cancelHold();
        type = "mousemove";
        event.preventDefault();this is where it breaks
        break;

    case "touchend":
        if (cancelMouseUp) {
            cancelMouseUp = false;
            event.preventDefault();this is where it breaks
            return false;
        }
        cancelHold();
        type = "mouseup";
        break;

    default:
        return;
}

我该如何解决?我尝试搜索,但找不到任何东西

0 个答案:

没有答案