简体   繁体   中英

Checking container, with dragula drag and drop, for correct answer

I'm making a simple game, based on drag'n'drop, using dragula ( https://github.com/bevacqua/dragula ). I want to move some containers, and if they are in correct order trigger an event sucess, if not event fail, but I don't have any idea how to check the container with answer every time something is droped in there. I was looking in dragula options, but I don't see anything. I'm trying to use only JavaScript. Do you have any ideas?

Thanks!

You have to add id or some attribute for the drop containers and then you have to store the id in the array or object , each time you drop you have to check with the answers. this way help to find the correct answers.

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