1

I have a div with images; the images needs to draggable to a div board.

My problem is if there are to much images (so overflow will show) the images can't be dragged outside the div. If there is no overflow its all good but with overflow the site fails.

I use:

 overflow-y:scroll;

to keep the layout the same all the time so there will always be overflow.

How can i avoid this overflow problem?

without overflow: http://jsfiddle.net/Z7Ume/1/

my example with overflow: http://jsfiddle.net/Z7Ume/

Irvin Dominin
  • 30,819
  • 9
  • 77
  • 111
Sven van den Boogaart
  • 11,833
  • 21
  • 86
  • 169

1 Answers1

3

By default, the drag helper is appended to the same container as the draggable. You can specify the appendTo option, it will be used as the draggable helper's container for dragging.

Example:

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

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

Working fiddle: http://jsfiddle.net/Z7Ume/3/

Similar question: jQuery Draggable and overflow issue

Community
  • 1
  • 1
Irvin Dominin
  • 30,819
  • 9
  • 77
  • 111