简体   繁体   中英

html5 draggable - arbitrary drop position?

All the examples that I've seen with draggable elements have a specific destination where the draggable element can be dropped. Is it possible to drop the element anywhere on the screen without specifying the destinations?

I have a map (ThinkGeo) with some specific areas coming from the database. when the user clicks/touches those areas, I'm showing popups with description of those areas. The popup is nothing else than a div that I'm showing and hiding accordingly.

The user wants to be able to move around the popup div on the map. Is this even possible?

Certainly possible and pretty easy with jQuery UI:

$("#elementId").draggable();

And a shim for touch events:

http://touchpunch.furf.com/ which at 584 bytes, is pretty lightweight.

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