简体   繁体   中英

How to avoid a draggable element to be dropped in a certain sortable location in jquery?

I have a page where two drag and drop functionalities are working. Suppose A and B are draggable components and C and D are droppable regions. But I have to restrict A being dropped in location D which is currently happening in my site. How to avoid it using sortable widget in jquery?

Sortable.create() method is used here.

You can restrict it with id or class selector just put a condition if a certain draggable item comes in non required dropable region don't call the draggable function just restrict this event and show some info message accordingly.

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