简体   繁体   中英

How to make some elements draggable and other droppable using HTML5?

I want to drag some elements and drop it in some other containers. The following example works for objects that are both draggable and droppable

http://jsfiddle.net/AwCuM/

But when I try to make some of them draggable and others only droppable it doesn't work

http://jsfiddle.net/4adJk/10/

I know how to use jQueryUI to do this, but I want to do the same using pure HTML5.

Looking at Mozilla's HTML docs I found that I need to handle the dragover event. The complete solution can be viewed at:

http://jsfiddle.net/Dema8/7/

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