Drop #div1 (draggable) into #div2 (droppable) only when a div that is a child of #div1 is over #div2
I try to drop a div into another one, using his child as the area that should activate the droppable.
To make things more clear let's say that we have #parent_div, #child_div and #droppable. I want to drag #parent_div over #droppable, but be able to drop it only when the s开发者_开发问答maller div (#child_div) inside it is over #droppable.
Is this possible using jQuery UI?
Thanks
"out of the box" I do not think this is possible. Look at the tolerance option. This is the extent of how you can define when the dragged item is over a target. "fit" or "intersect" might get you close to what you want, but not quite there.
To get what you want would require patching in a custom tolerance option. Or just implementing your own drag&drop.
精彩评论