JavaScript Reference/Event Handlers Reference/onMouseMove

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

"onMouseMove" Example

    
<head>
<script language="JavaScript">
    function function1(){
        alert("The "+event.type+" event fired") 
    } 
</script>
</head>
<body>
    <div id="myDiv" onmousemove="function1()">
        Move the mouse over this div element area.
    </div>
</body>



"onMouseMove" is applied to

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



"onMouseMove" Properties

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



"onMouseMove" Syntax and Note

Note:
    
This event fires when the mouse pointer moves.