How to determine where in the html code a draggable is dropped?
Hi All,
I've got an interesting challenge here. Is there an easy answer?
I've got a list of draggable blocks. They will each be associated with a block of text.
I would like the user to be able to drag these blocks of text onto a web page, and have them auto-inserted into the web page.
The web page is a bunch of <div>s at particular locations on the page. There's text inside the <div>s.
1) When a user drops the draggable onto a <div>, I'd like to have it inserted into the inner html at the appropriate place in the <div>.
2) When the user drops the draggable onto a "blank" space (a part of the page in the body, but not in a div underneath that), I'd like to create a new <div> with the text from the draggable inserted into it.
I grok draggable and droppable...it's just that I can't figure out how to handle the x,y to turn it into a particular spot in the html.
Can anyone help on this one?
Thanks!
-Ken