overflow:auto prevents dragging out of element

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

overflow:auto prevents dragging out of element

Post 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.
User avatar
aaronhall
DevNet Resident
Posts: 1040
Joined: Tue Aug 13, 2002 5:10 pm
Location: Back in Phoenix, missing the microbrews
Contact:

Post 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.
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post 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?
Post Reply