JavaScript Reference/Event Handlers Reference/onMouseWheel

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

"onMouseWheel" Example

   <source lang="javascript">
   

<html> <body>

Move the pointer on top of the image and then move the mouse wheel up or down.

   <img id="yourimage" 
        src="http://www.wbex.ru/style/logo.png" 
        onmousewheel="alert("Wheel Delta: " + event.wheelDelta);">

</body> </html>


     </source>
   
  


"onMouseWheel" is applied to

   <source lang="javascript">

+----------------+--------------------------------------------------------------+ | Applied_To |<a> <address> | | |<applet> <area> | | | |

| |
|

| |<body> <button> |

| |
|

| | | | |<custom>

| | | <dir> |

| |
|

| |document

| | | <embed> | | |<fieldset> | | |<form> <hn> |

| |
|

| |<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"> | | | <label> |

| |<legend>
  • | | |<listing> <map> | | |<marquee> <menu> | | |<nobr>
      | | |

                               |
      |                |                                                    |
      |                |                                                     |
      |                |<select>                                               |
      |                |                                                |
      |                |                                                 |
      |                |                                                  |
      |                |<tbody>                                                   |
      |                |                             
        | | | <xmp> | +----------------+--------------------------------------------------------------+ </source>

        "onMouseWheel" Properties

        <source lang="javascript"> +----------------+--------------------------------------------------------------+ | Properties |altKey altLeft | | |cancelBubble clientX | | |clientY ctrlKey | | |ctrlLeft offsetX | | |offsetY screenX | | |screenY shiftKey | | |shiftLeft srcElement | | |type wheelDelta | | |x y | +----------------+--------------------------------------------------------------+

        </source>



        "onMouseWheel" Syntax and Note

        <source lang="javascript"> Note:

        This event fires when the mouse wheel button rotates. This event is the only one that exposes the wheelDelta object property. wheelDelta returns a positive value when the wheel button has rotated away from the user, and a negative value when the wheel button has rotated toward the user.

        </source>

      |

      | |<textarea> <tfoot> |

      | |
      <thead> | | |