JavaScript Reference/Event Handlers Reference/onMouseLeave

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

"onMouseLeave" Example

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



"onMouseLeave" is applied to

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



"onMouseLeave" Properties

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



"onMouseLeave" Syntax and Note

Note:
    
This event fires when the mouse pointer leaves an object"s area.