JavaScript Tutorial/Drag Drop/ondrag

Материал из Web эксперт
Версия от 11:24, 26 мая 2010; Admin (обсуждение | вклад) (1 версия)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

ondrag event handler (IE)

   <source lang="javascript">

<html>

   <head>
       <title>System Drag And Drop Example</title>
       <script type="text/javascript">
           function handleDragDropEvent(oEvent) {
               var oTextbox = document.getElementById("txt1");
               oTextbox.value +=  oEvent.type + "\n";
           }
       </script>
   </head>
   <body>

Try dragging the image.

<img src="http://www.wbex.ru/style/logo.png" alt="www.wbex.ru" ondragstart="handleDragDropEvent(event)" ondrag="handleDragDropEvent(event)" ondragend="handleDragDropEvent(event)" />

<textarea rows="10" cols="25" readonly="readonly" id="txt1"></textarea>

   </body>

</html></source>