Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.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 ui iframe中的Jquery UI可拖动滚动问题_Jquery Ui_Draggable_Droppable - Fatal编程技术网

Jquery ui iframe中的Jquery UI可拖动滚动问题

Jquery ui iframe中的Jquery UI可拖动滚动问题,jquery-ui,draggable,droppable,Jquery Ui,Draggable,Droppable,我试图用自动滚动功能在我的网页上拖出一个答案。 但由于某种原因,我的卷轴不起作用。它被放置在iframe中。 我参考了JqueryUI的参考资料,但没有找到合适的答案 有时它也会在这个网页之外的项目中的其他地方工作 下面是我的可拖动jquery var draggableAnswers = machingQuestionElement.find(".answer"); draggableAnswers.draggable({ revert: "invalid", handle:

我试图用自动滚动功能在我的网页上拖出一个答案。 但由于某种原因,我的卷轴不起作用。它被放置在iframe中。 我参考了JqueryUI的参考资料,但没有找到合适的答案

有时它也会在这个网页之外的项目中的其他地方工作

下面是我的可拖动jquery

    var draggableAnswers = machingQuestionElement.find(".answer");
    draggableAnswers.draggable({ revert: "invalid", handle: draggableAnswers.find(".Answerhandle"), axis: 'y', containment: "document" });
    var dropboxes = machingQuestionElement.find(".answerDropbox");
    dropboxes.droppable({ accept: draggableAnswers,
        drop: function (event, ui) {
            $(this).removeClass("border").removeClass("over");
            var droppedAnswer = ui.draggable;
            var currentDroppbox = $(this);

            currentDroppbox.height(droppedAnswer.find('.AnswerText').height());
            droppedAnswer.height(droppedAnswer.find('.AnswerText').height());
            //Previous box 
            var previousDropbox = droppedAnswer.parent(".answerDropbox");
            previousDropbox.droppable("option", "disabled", false);
            previousDropbox.find(".placeholder").show();
            $(droppedAnswer).detach().css({ top: 0, left: 0 }).appendTo(currentDroppbox);
            var currentSubQuestion = currentDroppbox.closest(".subQuestion");
            machingQuestionElement.find("input[value=" + droppedAnswer.attr("id") + "]").prop('checked', false);
            var inputDroppedAnswer = currentSubQuestion.find("input[value=" + droppedAnswer.attr("id") + "]")
            inputDroppedAnswer.prop('checked', true);
            if (inputDroppedAnswer.attr("speciality") == "true")
                droppedAnswer.addClass("correctAnswer");
            else
                droppedAnswer.removeClass("correctAnswer");
            currentDroppbox.droppable("option", "disabled", true);
            currentDroppbox.find(".placeholder").hide();
        },
        over: function (event, elem) {
            $(this).addClass("over");
        },
        out: function (event, elem) {
            $(this).removeClass("over");
        }
    });

老兄,我本打算提出一个可拖动的查询,但为了更好地理解,我已经这样做了。这不是一个MCVE,因为我不能仅仅运行代码并重现问题。谢谢你的建议。下次我会记住这件事。你能回答我的问题吗?