Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 拖放时忽略取消可取消=false的touchstart事件的尝试_Jquery_Drag And Drop_Touch - Fatal编程技术网

Jquery 拖放时忽略取消可取消=false的touchstart事件的尝试

Jquery 拖放时忽略取消可取消=false的touchstart事件的尝试,jquery,drag-and-drop,touch,Jquery,Drag And Drop,Touch,嗨,我试图在另一个div中拖动一些按钮/图像,但我不断收到以下警告 Ignored attempt to cancel a touchstart event with cancelable=false, for example because scrolling is in progress and cannot be interrupted. 这是我的密码 <link rel="stylesheet" href="bootstrap-3.3.6-dist/css/bootstrap

嗨,我试图在另一个div中拖动一些按钮/图像,但我不断收到以下警告

Ignored attempt to cancel a touchstart event with cancelable=false, for example because scrolling is in progress and cannot be interrupted.  
这是我的密码

<link rel="stylesheet" href="bootstrap-3.3.6-dist/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="bootstrap-3.3.6-dist/css/bootstrap-theme.min.css">
<script src="bootstrap-3.3.6-dist/js/bootstrap.min.js"></script>
<script src="js/jquery-2.1.4.min.js"></script>


<link href="css/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script src="js/jquery-ui.min.js"></script>
<script src="js/jquery.ui.touch-punch.min.js"></script>



<script>

    $(function () {
        $(".btn-popup-sources img").draggable({
        cancel :false,
        revert: "invalid",
        refreshPositions: true,
        drag: function (event, ui) {
            ui.helper.addClass("draggable");
        },
        stop: function (event, ui) {
            ui.helper.removeClass("draggable");
            var image = this.src.split("/")[this.src.split("/").length - 1];
            if ($.ui.ddmanager.drop(ui.helper.data("ui-draggable"), event)) {
                alert(image + " dropped.");
            }
            else {
                alert(image + " not dropped.");
            }
        }
    });
    $("#droppedHere").droppable({
        drop: function (event, ui) {
            if ($("#droppedHere img").length == 0) {
                $("#droppedHere").html("");
            }
            ui.draggable.addClass("dropped");
            $("#droppedHere").append(ui.draggable);
        }
    });

});

</script>  

$(函数(){
$(“.btn弹出源img”).draggable({
取消:错,
回复:“无效”,
他说:对,,
拖动:函数(事件、ui){
ui.helper.addClass(“可拖动”);
},
停止:功能(事件、用户界面){
ui.helper.removeClass(“可拖动”);
var image=this.src.split(“/”[this.src.split(“/”).length-1];
if($.ui.ddmanager.drop(ui.helper.data(“ui可拖动”),事件)){
警报(图像+“已删除”);
}
否则{
警报(图像+“未删除”);
}
}
});
$(“#droppedHere”)。可拖放({
drop:函数(事件、用户界面){
if($(“#droppedHere img”).length==0){
$(“#droppedHere”).html(“”);
}
ui.draggable.addClass(“已删除”);
$(“#droppedHere”).append(ui.draggable);
}
});
});
我试着在网上查看,但没有找到合适的解决方案