Parent div does not scroll on dragging a child inside of it

1.3k views Asked by At

I have a parent div with many child divs.

I want when a child div is dragged inside the parent div, then the parent div to scroll. When the parent div is the body, it works. But I want it to work with my own parent "content" div.

Here is a js example of the problem: http://jsfiddle.net/yzx4ft46/

Any ideas why it doesn't work?

1

There are 1 answers

0
Petar Minchev On BEST ANSWER

It seems that the parent div must have position: relative and it started working:)

Since the cloned element has position absolute and absolute positioning is positioned according to the first parent element with other then static positioning, then it is needed the parent element to have position: relative.