Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

wheelDelta property

Retrieves the distance and direction the wheel button has rolled.



p = object.wheelDelta


Property values

Type: Integer

the distance and direction that the wheel button has rolled.


This property indicates the distance that the wheel has rotated, expressed in multiples of 120. A positive value indicates that the wheel has rotated away from the user. A negative value indicates that the wheel has rotated toward the user.

This property is used with the onmousewheel event.

wheelDelta was introduced in Microsoft Internet Explorer 6


The following example shows how to use the wheelDelta with the onmousewheel event to measure the distance the wheel button has rotated. Measurement values of wheelDelta are in multiples of 120.

Code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/wheelDeltaEX.htm

<!DOCTYPE html>
  <title>wheelDelta Property Example</title>
    .intro {
      background: #e4e4e4;
      color: black;
      font-weight: bold;
      font-size: 13pt;
      padding: 10px;

  <h1>wheelDelta Property Example</h1>
  <p>Roll the mousewheel back and forth to observe the value of <strong>wheelDelta</strong> property.</p>
  <div class="intro">
    wheelDelta: (<span style="color: red" id="oNotice"></span>)
    var oNotice = document.getElementById('oNotice');
    window.addEventListener('mousewheel', handleMouseWheel, false);
    function handleMouseWheel(evt) {
      oNotice.textContent = evt.wheelDelta;

See also




© 2015 Microsoft