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
MouseWheelEventand 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
Constructors
WheelEvent()
public WheelEvent()
WheelEvent(string, WheelEventInit)
The WheelEvent() constructor returns a new WheelEvent object.
public WheelEvent(string type, WheelEventInit eventInitDict = null)
Parameters
typestringeventInitDictWheelEventInit
Remarks
NOTE
If you construct a synthetic event using this constructor, that event will not be trusted, for security reasons.
Only browser-generatedWheelEventobjects are trusted and only trusted events trigger default actions.
-The WheelEvent interface it belongs to.
Fields
DOM_DELTA_LINE
[Value("DOM_DELTA_LINE")]
public const ulong DOM_DELTA_LINE = 1
Field Value
DOM_DELTA_PAGE
[Value("DOM_DELTA_PAGE")]
public const ulong DOM_DELTA_PAGE = 2
Field Value
DOM_DELTA_PIXEL
[Value("DOM_DELTA_PIXEL")]
public const ulong DOM_DELTA_PIXEL = 0
Field Value
Properties
DeltaMode
The WheelEvent.deltaMode read-only property returns anunsigned 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 |
|
| The delta values are specified in pixels. |
|
| The delta values are specified in lines. |
|
| 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
DeltaX
The WheelEvent.deltaX read-only property is adouble 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
DeltaY
The WheelEvent.deltaY read-only property is adouble 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
DeltaZ
The WheelEvent.deltaZ read-only property is adouble 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