Jquery arrastrar y soltar en div vacío y volver

I was having difficulty trying to figure out how to drag and drop between two different div's and I found a reference to http://docs.jquery.com/UI/Sortable#option-connectWith in another post and it works magnificently... Almost anyway.

I am now able to drag items between divs but if I drag the last item from a div it becomes closed to me. I can't drag anything back into it... Is there something basic I am missing?

Gracias por cualquier ayuda!

preguntado el 22 de mayo de 12 a las 20:05

¿Qué tal establecer un min-height on the div? -

Thanks, I feel extremely stupid right now. -

We've all been there! :D -

I definitely need to do more front end work :) -

2 Respuestas

Podrías simplemente agregar un display:none; elemento en cada div

contestado el 22 de mayo de 12 a las 20:05

Yeah, I figured this out after that comment. Thanks! I feel stupid for missing something so obvious. - Sean

When you drag the last element from the div it's likely collapsing, which is almost like removing the div. As state in the comment you should set a min-height for the div, and possibly a min-width as well to prevent the div for collapsing when it's empty.

contestado el 22 de mayo de 12 a las 20:05

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.