Jump to content

Drag and Drop (Word inside a text)


alim
 Share

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...