Table of Contents

Class WheelEvent

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The WheelEvent interface represents events that occur due to the user moving a mouse wheel or similar input device.

[Value("WheelEvent")]
public class WheelEvent : MouseEvent
Inheritance
WheelEvent
Inherited Members

Remarks

NOTE

This is the standard wheel event interface to use. Old versions of browsers implemented the non-standard and non-cross-browser-compatible MouseWheelEvent and MouseScrollEvent interfaces. Use this interface and avoid the non-standard ones.

Don't confuse the wheel event with the Elementscroll event:

-Elementwheel event
-Interfaces replaced by this one:-Gecko's legacy mouse wheel event object: MouseScrollEvent

See also on MDN

Constructors

WheelEvent()

public WheelEvent()

WheelEvent(string, WheelEventInit)

The WheelEvent() constructor returns a new WheelEvent object.

public WheelEvent(string type, WheelEventInit eventInitDict = null)

Parameters

type string
eventInitDict WheelEventInit

Remarks

NOTE

If you construct a synthetic event using this constructor, that event will not be trusted, for security reasons.
Only browser-generated WheelEvent objects are trusted and only trusted events trigger default actions.

-The WheelEvent interface it belongs to.

See also on MDN

Fields

DOM_DELTA_LINE

[Value("DOM_DELTA_LINE")]
public const ulong DOM_DELTA_LINE = 1

Field Value

ulong

DOM_DELTA_PAGE

[Value("DOM_DELTA_PAGE")]
public const ulong DOM_DELTA_PAGE = 2

Field Value

ulong

DOM_DELTA_PIXEL

[Value("DOM_DELTA_PIXEL")]
public const ulong DOM_DELTA_PIXEL = 0

Field Value

ulong

Properties

DeltaMode

The WheelEvent.deltaMode read-only property returns an
unsigned long representing the unit of the delta values scroll amount.
Permitted values are:

[Value("deltaMode")]
public ulong DeltaMode { get; }

Property Value

ulong

An unsigned long.

Remarks

Constant

Value

Description

DOM_DELTA_PIXEL

0x00

The delta values are specified in pixels.

DOM_DELTA_LINE

0x01

The delta values are specified in lines.

DOM_DELTA_PAGE

0x02

The delta values are specified in pages.

You must check the deltaMode property to determine the unit of the deltaX, deltaY, and deltaZ values. Do not assume that those values are specified in pixels. Some browsers, for compatibility reasons, may return different units for the delta* values depending on whether deltaMode has been accessed, to accommodate for websites not explicitly checking the deltaMode property.

-Elementwheel
-WheelEvent

See also on MDN

DeltaX

The WheelEvent.deltaX read-only property is a
double representing the horizontal scroll amount in the
DeltaMode unit.

[Value("deltaX")]
public Number DeltaX { get; }

Property Value

Number

A number.

Remarks

You must check the deltaMode property to determine the unit of the deltaX value. Do not assume that the deltaX value is specified in pixels. Some browsers, for compatibility reasons, may return different units for the deltaX value depending on whether deltaMode has been accessed, to accommodate for websites not explicitly checking the deltaMode property.

-Elementwheel
-WheelEvent

See also on MDN

DeltaY

The WheelEvent.deltaY read-only property is a
double representing the vertical scroll amount in the
DeltaMode unit.

[Value("deltaY")]
public Number DeltaY { get; }

Property Value

Number

A number.

Remarks

You must check the deltaMode property to determine the unit of the deltaY value. Do not assume that the deltaY value is specified in pixels. Some browsers, for compatibility reasons, may return different units for the deltaY value depending on whether deltaMode has been accessed, to accommodate for websites not explicitly checking the deltaMode property.

-Elementwheel
-WheelEvent

See also on MDN

DeltaZ

The WheelEvent.deltaZ read-only property is a
double representing the scroll amount along the z-axis, in the
DeltaMode unit.

[Value("deltaZ")]
public Number DeltaZ { get; }

Property Value

Number

A number.

Remarks

You must check the deltaMode property to determine the unit of the deltaZ value. Do not assume that the deltaZ value is specified in pixels. Some browsers, for compatibility reasons, may return different units for the deltaZ value depending on whether deltaMode has been accessed, to accommodate for websites not explicitly checking the deltaMode property.

-Elementwheel
-WheelEvent

See also on MDN