Page 1 of 1

Drag-and-Drop from one cell to another

Posted: Mon Aug 08, 2005 2:43 am
by anjanesh
I have 2 tables - ids t1 and t2, each having just one cell.
t1 has some text content in it.

1. Is there a way to 'drag-and-drop' the t1's contents to t2 ? Or would I need to code the mousedown and mouseup events for this ?

2. If coding mouse events is the only option then would it possible to have the text not selected. Because the cell contains text, when I drag and move the text gets selected - any way to stop this ?

Thanks

Posted: Mon Aug 08, 2005 3:22 am
by Chris Corbyn
Not sure with text but perhaps looking over the code at http://www.walterzorn.com/ might help ;)

Posted: Mon Sep 12, 2005 2:06 pm
by anjanesh
Mozilla's specific CSS -moz-user-select doesnt allow user to select the text.
Coming in CSS3 as user-select - this is long way to go.

Posted: Mon Sep 12, 2005 4:17 pm
by raghavan20
I am thinking like...you get the co-ordinates of all tables or divs in a page.
try to move an image out of the source div and during the mouse out event find the co-ordinates of the cursor.
try to match the co-ordinates with the co-ordinates you have of all divs or tables.
if you find a match and if thats a container for sure, you can now use innerHTML for div / dynamically create tr, td to copy the text to the destination.