OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <!-- Frame that can be used to test drop of a drag-and-drop operation. |
| 3 The drop target (a <div>) fills the frame from (0,0) to (199,199). |
| 4 --> |
| 5 <head> |
| 6 <meta charset="utf-8"> |
| 7 <style> |
| 8 div { |
| 9 position: absolute; |
| 10 top: 0px; |
| 11 left: 0px; |
| 12 width: 160px; |
| 13 height: 160px; |
| 14 border: 0px; |
| 15 margin: 0px; |
| 16 padding: 20px; |
| 17 text-align: center; |
| 18 vertical-align: middle; |
| 19 } |
| 20 </style> |
| 21 <script src="event_monitoring.js"></script> |
| 22 <script> |
| 23 function dragover_handler(ev) { |
| 24 window.reportDragAndDropEvent(ev); |
| 25 |
| 26 // This communicates that we support drag & drop. |
| 27 // Without this, the "drop" event handler below would not fire. |
| 28 ev.preventDefault(); |
| 29 } |
| 30 |
| 31 function drop_handler(ev) { |
| 32 window.reportDragAndDropEvent(ev); |
| 33 |
| 34 // This communicates that we have handled the drop |
| 35 // (i.e. that there is no other, default action to take). |
| 36 ev.preventDefault(); |
| 37 } |
| 38 </script> |
| 39 </head> |
| 40 <body> |
| 41 <div ondragover="dragover_handler(event);" ondrop="drop_handler(event);"> |
| 42 <p>Use this frame as a target of a drag-n-drop</p> |
| 43 </div> |
| 44 </body> |
OLD | NEW |