Get drag and drop event type : Drag Drop Event : Drag Drop JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Drag Drop » Drag Drop Event »

 

Get drag and drop event type

















<html>
    <head>
        <title>System Drag And Drop Example</title>
        <script type="text/javascript">
            function handleDragDropoEvent(oEvent) {

                switch(oEvent.type) {
                    case "dragstart":
                        oEvent.dataTransfer.effectAllowed = "move";
                        alert("dragstart");
                        break;

                }
            }
        </script>
    </head>
    <body>
        <P>Try dragging the text in the textbox to the right textbox.</p>
        <P><input type="text" value="drag this text" ondragstart="handleDragDropoEvent(event)" />
        <input ondragenter="handleDragDropoEvent(event)"
               ondragover="handleDragDropoEvent(event)"
               ondrop="handleDragDropoEvent(event)">
        </input>
        </p>

    </body>
</html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Drag Drop
» Drag Drop Event