JavaScript Reference/Event Handlers Reference/onDragOver

Материал из Web эксперт
Перейти к: навигация, поиск

"onDragOver" Example

    
<html>
<head>
<script language="JavaScript">
<!--
function function1() {
  msg = "on" + event.type + " event fired by " + """ + event.srcElement.id + """; 
  alert(msg+"\nPress Enter twice to close this window") 
} 
--> 
</script>
</head>
<body bottommargin=150>
  <p>Source object: 
<input id="sourceObject" size=50 value="The text to Drag" ondragover="function1()">
<br>
  </p>
  <p>Drop selected text into the following text field.</p>
  Target object: 
<input id="targetObject" size=50 value="Drag destination element"> 
</body>
</html>



"onDragOver" is applied to

+----------------+--------------------------------------------------------------+
| Applied_To     |<a>                             <acronym>                     |
|                |<address>                       <area>                        |
|                |<b>                             <bdo>                         |
|                |<big>                           <blockquote>                  |
|                |<body>                          <button>                      |
|                |<caption>                       <center>                      |
|                |<cite>                          <code>                        |
|                |<custom>                        <dd>                          |
|                |<del>                           <dfn>                         |
|                |<dir>                           <div>                         |
|                |<dl>                            document                      |
|                |<dt>                            <em>                          |
|                |<fieldset>                      <font>                        |
|                |<form>                          <hn>                          |
|                |<hr>                            <i>                           |
|                |<img>                           <input type="button">         |
|                |<input type="checkbox">         <input type="file">           |
|                |<inputtype="image">             <input type="password">       |
|                |<input type="radio">            <input type="reset">          |
|                |<input type="submit">           <input type="text">           |
|                |<kbd>                           <label>                       |
|                |<li>                            <listing>                     |
|                |<map>                           <marquee>                     |
|                |<menu>                          <nobr>                        |
|                |<object>                        <ol>                          |
|                |<option>                        <p>                           |
|                |<pre>                           <q>                           |
|                |<s>                             <samp>                        |
|                |<select>                        <small>                       |
|                |<span>                          <strike>                      |
|                |<strong>                        <sub>                         |
|                |<sup>                           <table>                       |
|                |<tbody>                         <td>                          |
|                |<textarea>                      <tr>                          |
|                |<tt>                            <u>                           |
|                |<ul>                            <var>                         |
|                |<xmp>                                                         |
+----------------+--------------------------------------------------------------+



"onDragOver" Properties

+----------------+--------------------------------------------------------------+
| Properties     |altKey                          altLeft                       |
|                |cancelBubble                    clientX                       |
|                |clientY                         ctrlKey                       |
|                |ctrlLeft                        dataTransfer                  |
|                |offsetX                         offsetY                       |
|                |returnValue                     screenX                       |
|                |screenY                         shiftLeft                     |
|                |srcElement                      type                          |
|                |x                               y                             |
+----------------+--------------------------------------------------------------+



"onDragOver" Syntax and Note

Note:
    
This event fires continuously while the cursor is on the target area in a 
drag-and-drop operation.
For this event to fire, the object must support drag-and-drop.