Page 1 of 1

overflow:auto prevents dragging out of element

Posted: Sun Sep 17, 2006 12:20 am
by Burrito
I have a div where the overflow property is set to auto so that when I add elements as children that go beyond the y scale of the div, it scrolls. I'm making a little drag and drop application and when I drag one of the child elements out of the div (or at least try to), the element I'm dragging disappears behind other elements that are outside of my overflowed div.

when I change the overflow property to visible, the dragging works fine. As a workaround, I made it so that when you click an item to drag it outside of the div, it changes the property of the div to visible, there are two problems with that, one: when I try to drag an element for which I had to scroll, the dragging gets completely borked because the height of the element gets changed. two: it looks horrible when all of a sudden 10 more elements just appear as I'm dragging out.

I know this probably doesn't make a whole lot of sense without seeing it applied, but I can't really show what I'm doing for this particular application. If any of you have run across this, but more importantly, have run across a solution, I'd be very grateful to hear it.

Posted: Sun Sep 17, 2006 1:54 am
by aaronhall
Maybe leaving overflow at auto and setting z-index on the div elements to 0 or -1? I'm not very familiar with CSS layers, but I'd give this a try first.

Posted: Sun Sep 17, 2006 12:09 pm
by Burrito
yeah, I've made sure the z-index is higher on the elements I"m dragging. In fact I've made the z-index upwards of 10000. thats not the problem as indicated by the fact that if I change the overflow property to visible, they don't disapear, it's something to do with the overflow being set to auto.

any other ideas?