Initializes a new WheelEvent that the createEvent method created.
Method of dom/WheelEventdom/WheelEvent
Syntax event.initWheelEvent();
Parameters eventType
The name of the event. Sets the value for the type property.
canBubbleWhether the event propagates upward. Sets the value for the bubbles property.
cancelableWhether the event is cancelable and so preventDefault can be called. Sets the value for the cancelable property.
viewThe window on which this event is occurring. Sets the value for the view property.
detailSpecifies additional information. This value is returned in the detail property of the event.
screenXThe x-coordinate of the mouse pointer, relative to the upper-left corner of the screen. Sets the value for the screenX property,
screenYThe y-coordinate of the mouse pointer, relative to the upper-left corner of the screen. Sets the value for the screenY property.
clientXThe x-coordinate of the mouse pointer, relative to the upper-left corner of the browser’s client area. Sets the value for the clientX property.
clientYThe y-coordinate of the mouse pointer, relative to the upper-left corner of the browser’s client area. Sets the value for the clientY property.
buttonThe mouse button that caused the event. Sets the value for the button property (see the property page for common values).
relatedTargetA secondary element that is involved in the event. Sets the value for the relatedTarget property.
modifiersListArgA space-separated list of any of the following values:
Other implementation specific options may be supported. For example -
The distance that the mouse wheel has rotated around the x-axis. Sets the value for the deltaX property.
deltaYThe distance that the mouse wheel has rotated around the y-axis. Sets the value for the deltaY property.
deltaZThe distance that the mouse wheel has rotated around the z-axis. Sets the value for the deltaZ property.
deltaModeThe delta mode of the event. Sets the value for the deltaMode property (see the property page for common values).
Return ValueNo return value
Examplesfunction dispatchWheelEvent(){
var evt=document.createEvent('WheelEvent');
var theform=document.forms.dispatch;
evt.initWheelEvent('wheel',
theform.chkcanbubble.checked,
theform.chkcancellable.checked,
eval(theform.view.value),
theform.detail.value,
theform.screenx.value,
theform.screeny.value,
theform.clientx.value,
theform.clienty.value,
theform.button.value,
null,
theform.modifierlist.value,
theform.deltax.value,
theform.deltay.value,
theform.deltaz.value,
theform.cbodeltamode.value);
window.dispatchEvent(evt);
}
Related specifications
Microsoft Developer Network: [initWheelEvent Article]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4