How to make the Droppable event is not repeated, the parent(s)?

Good evening.
There
<div class="to_me">
<span class="me">me <span class="to_me">place</span> and <span class="to_me">place</span></span>
<span class="me">me <span class="to_me">place</span> and <span class="to_me">place</span></span>
<span class="me">me <span class="to_me">place</span> and <span class="to_me">place</span></span>
<span class="me">me <span class="to_me">place</span> and <span class="to_me">place</span></span>
</div>
in "to_me" you can insert "me" but if you do this more deeply in a branch of the DOM event $(".to_me").droppable({drop:func}) recursively goes through the parents.
in addition, the lighting is wrong because of this $(".to_me").droppable({hoverClass:"to_me_2"})
How can I solve the problem?
July 9th 19 at 10:44
3 answers
July 9th 19 at 10:46
Solution
If you yuzaete jqueryui, try property greedy api.jqueryui.com/droppable/#option-greedy
worked. but here's another question: to_me I have a size smaller than me. event droppable works to center me. and for convenience you need to keep this area was under the mouse. how to do? - Josiane75 commented on July 9th 19 at 10:49
: option: tolerance, there in the API, all properties are described - read ;) - Tessie commented on July 9th 19 at 10:52
: thank you.
this just won't be there: how to make one "place" you can put only one element? change class to another and again to buy $(".to_me").droppable() and $(".me").draggable() ?although it may not work - will not overwrite the event on the element whose class is changed? as better? - Josiane75 commented on July 9th 19 at 10:55
July 9th 19 at 10:48
$('span.to_me') may well help to get rid of the parent
$("span.to_me").droppable to do? - Josiane75 commented on July 9th 19 at 10:51
I understand what was the reply sent - can all go very deeply. But Your answer slightly improves the functionality of your code.. - Tessie commented on July 9th 19 at 10:54
: Yes, the parent will be excluded, as it dives - Josiane75 commented on July 9th 19 at 10:57
above you will see my comment. besides, he also needs to have such properties. - Josiane75 commented on July 9th 19 at 11:00
I think you get the nesting can be more than 2 levels, ideally then you need to separate each unit from each other, and how much vaginata, so many .droppable calls to make for each group - Josiane75 commented on July 9th 19 at 11:03
: the answer was... - aniya.Kertzmann65 commented on July 9th 19 at 11:06
July 9th 19 at 10:50
Event.preventDefaults();
and what does it mean? - Josiane75 commented on July 9th 19 at 10:53
: freeze distribution of events. Well, there are still other. - Tessie commented on July 9th 19 at 10:56
: Ah... but already found a solution. - Josiane75 commented on July 9th 19 at 10:59
: well... mine, among other things, easier. And learn JS. - Josiane75 commented on July 9th 19 at 11:02

Find more questions by tags jQuery