I have a table that will contain elements dragged into each cell by the user.
<td ondrop="dropIt(event);" ondragover="dragOver(event)" onMouseOver="this.bgColor='grey';" onMouseOut="this.bgColor='white';"></td>
When the user mouses over a cell, I want it to turn grey. When the mouse exits the cell i want it to turn white again.
Likewise, when a user drags an element over a cell, i want it to turn grey. The problem i'm having is turning it white again after the user moves to another cell. Is there some kind of ondragout
event in html ?
Thanks
The ondragover event occurs when a draggable element or text selection is being dragged over a valid drop target. By default, data/elements cannot be dropped in other elements. To allow a drop, we must prevent the default handling of the element. This is done by calling the event.
The dragover event is fired when an element or text selection is being dragged over a valid drop target (every few hundred milliseconds). The event is fired on the drop target(s).
The drag event is fired every few hundred milliseconds as an element or text selection is being dragged by the user.
Sorry for the stupid question ! I just found the ondragleave
event.
Thanks
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With