Jump to content

Drag and Drop (Word inside a text)


alim

Recommended Posts

hello all,i've written a drag and drop application that can moves pictures and so on, but i need to drag a highlighted (selected) word from a text and make its position a drop-reciever. Does anyone have any idea how to code this ??? till now i have a function that gives me the selected string. but in order to make it dragable i must make its position absolute and to do so i have to define a div element (span ??? i don't know ecxacly) over the stirng and i can't reach this. Many thanks an all kind of help (ideas, links soo...)

Link to comment
Share on other sites

If you want to drag something onto selected text, the only way I can think if you already have the selected string is to have the mouseup handler determine which text node the draggable object is over and replace the substring with whatever represents the draggable object. This is more of a find and replace in text, where it will replace the selected string wherever it appears in the text node, but as far as I know you can't get any sort of position information with selected text because the selected text is not an object, it's part of a larger text node.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...