views:

150

answers:

1

Hi There, I have a simple UL in a div with the overflow set to automatic and a fixed height. Each LI is draggable via jQuery. Problem is that I cannot drag them from the div (they disappear when dragged to the boundaries).

I have looked at this question and its answers, but the solution here does not seem to work for me (setting the scroll option): http://stackoverflow.com/questions/811037/jquery-draggable-and-overflow-issue

Thanks

+4  A: 

Hi,

I got around this by using a helper method to append the item to the body (so its outside the div)

$("#myitem").draggable({
helper: function() { return $(this).clone().appendTo('body').show(); }
});

Not sure if you need the show() and I also had to raise the z-index but it depends on the rest of your page.

Phil

Phil
perfect. I did originally try the appendTo: 'body' option, which I would have thought would have the same effect, but didnt!
Sergio
Glad to help, took me hours to figure this out too :)
Phil