Categories
Most commented
-
Recent Posts
Recent Comments
- Bruce996 on Drag and Drop table content with JavaScript
- dbunic on REDIPS.drag documentation
- dbunic on Drag and Drop table content with JavaScript
- joven on REDIPS.drag documentation
- Scott on Drag and Drop table content with JavaScript
- dbunic on Adding table rows and columns in JavaScript
- Zark on Adding table rows and columns in JavaScript
Documentation
-
Archive for the Category: Drag and Drop
JavaScript Drag and Drop example 2
This post shows how to use Drag and Drop library described in my previous post "Drag and drop table content with JavaScript". HTML table is stylized to have left column with content, main table and message line. Elements on the left side (green and orange) should be placed to the coloured table cells. After elements are correctly sited, appropriate message will be displayed.
Drag and Drop table content with JavaScript
Content of HTML table cells can be dragged to another table cell or another table. It isn't difficult to define onMouseMove handler and change top / left element styles to move the object. In case with tables, you will have to determine somehow destination table cell. Attaching onMouseOver handler on table cells will not work, because browser doesn't fire events to the elements beneath the dragged object.