Jquery Drag and drop to arbitray location
-
09-09-2019 - |
Question
I've got a situation where a user needs to be able to drag and drop an image onto a section of a dynamically generated portion of a page that will will always be enclosed with <pre> </pre>
tags but will have no other information.
The only way I can I think to accomplish this is to add a wrapper div with a different z-index, but is it even possible to "drop" this item on an arbitrary location on the layer above the pre-formatted text?
Any suggestions/ideas would be greatly appreciated.
Solution
Have you seen the JQuery UI. You can literally in its simplest form to do this:
$("#MyDragElement").draggable();
AND
$("#MyDropElement").droppable();
Documentation:
Check it out: :-)
Andrew
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow