www.fgks.org   »   [go: up one dir, main page]

Click to Rate and Give Feedback
Properties
 wheelDelta Property
wheelDelta Property

Retrieves the distance and direction the wheel button has rolled.

Syntax

[ p = ] event.wheelDelta

Possible Values

pInteger that receives the distance and direction that the wheel button has rolled.

The property is read-only. The property has no default value.

Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see About Dynamic Properties.

Remarks

wheelDelta was introduced in Microsoft Internet Explorer 6

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.

Example

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.


<HTML>
<HEAD>
<SCRIPT>
function updateDelta(){
   oNotice.innerText=event.wheelDelta;
}
</SCRIPT>
</HEAD>
<BODY>
<DIV >Place cursor over this sentence and roll! wheelDelta: 
(<SPAN ID="oNotice"></SPAN>)
</DIV>
</BODY>
</HTML>
This feature requires Microsoft® Internet Explorer 6 or later. Click the following icon to install the latest version. Then reload this page to view the sample.

Standards Information

There is no public standard that applies to this property.

Applies To

event
Tags What's this?: Add a tag
Community Content
 
Add Community Content
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker
DCSIMG