简体   繁体   中英

jquery ui droppable: most dropped on?

I have two droppables very close together, and a draggable can be dropped on both at the same time. Is there a way to figure out which one it is dropped more on, defined by % overlap?

Thank you.

-Nick

  1. Get the absolute position of both static elements ( http://api.jquery.com/offset/ )
  2. Get the absolute position of the draggable element
  3. Calculate the size of the overlap between the draggable element and each static element

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM