【问题标题】:Not draggable outside overflow不可拖动外溢
【发布时间】:2013-03-30 11:00:08
【问题描述】:

我有一个带有图像的 div;图像需要可拖动到 div 板。

我的问题是如果有太多图像(所以溢出会显示)图像不能被拖到 div 之外。 如果没有溢出,一切都很好,但如果溢出,网站就会失败。

我用:

 overflow-y:scroll;

始终保持布局相同,因此总会有溢出。

如何避免这个溢出问题?

没有溢出:http://jsfiddle.net/Z7Ume/1/

我的溢出示例:http://jsfiddle.net/Z7Ume/

【问题讨论】:

    标签: jquery jquery-ui


    【解决方案1】:

    默认情况下,拖动助手被附加到与可拖动对象相同的容器中。您可以指定appendTo 选项,它将用作可拖动助手的容器进行拖动。

    例子:

    $(".Item").draggable({
        helper: "clone",
        containment: "#Inhoud",
        revert: "invalid",
        appendTo: "body"
    });
    

    文档:http://api.jqueryui.com/draggable/#option-appendTo

    工作小提琴:http://jsfiddle.net/Z7Ume/3/

    类似问题:jQuery Draggable and overflow issue

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-10-17
      • 2012-05-06
      • 2014-10-26
      • 1970-01-01
      • 2011-08-16
      • 1970-01-01
      • 2011-01-07
      相关资源
      最近更新 更多