By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,635 Members | 2,240 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,635 IT Pros & Developers. It's quick & easy.

Drag and Drop contents of a cell to another cell

P: 7
Hi,

I need to drag and drop the contents of a cell in to another cell.

Thanks in advance.
Sanks
Dec 19 '06 #1
Share this Question
Share on Google+
1 Reply


b1randon
Expert 100+
P: 171
Hi,

I need to drag and drop the contents of a cell in to another cell.

Thanks in advance.
Sanks
Sanks, you can do something quick a dirty like this:

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <script language="JavaScript" type="text/javascript">
  4. var content = "";
  5. function drag(me){
  6.     content = me.innerHTML;
  7. }
  8. function drop(me){
  9.     me.innerHTML = content;
  10. }
  11. </script>
  12. </head>
  13. <body>
  14.     <table border="1">
  15.         <tr>
  16.             <td onmousedown="drag(this);">Drag me</td>
  17.             <td onmouseup="drop(this);">Drop here</td>
  18.         <tr>
  19.     </table>
  20. </body>
  21. </html>
  22.  
But there's an inherent browser issue with highlight and dragging images that is tricky and really depends on your content. You can find more info on it from Professor David Dailey's website. I was under his tutelage during my college career. I hope that helps.
Dec 19 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.