M MouseEvent.initMouseEvent() (Method) MouseEvent.initMouseEvent() (Method) After creating (X web hosting)
Monday, December 17th, 2007M MouseEvent.initMouseEvent() (Method) MouseEvent.initMouseEvent() (Method) After creating a MouseEventobject, it must be initialised with this method call. Availability: DOM level 2 JavaScript 1.5 Netscape 6.0 JavaScript syntax: N myMouseEvent.initMouseEvent(aType, aBubble, aCancel, aView, aDetail, aScrnX, aScrnY, aClntX, aClntY, aCtrl, anAlt, aShift, aMeta, aButton, aRelTarg) aType A string value describing the event type aBubble A boolean flag indicating whether the event can bubble aCancel A boolean flag indicating whether the event can be cancelled aView A reference to an AbstractView object aDetail A value describing the event detail aScrnX A screen X coordinate value aScrnY A screen Y coordinate value aClntX A client X coordinate value aClntY A client Y coordinate value aCtrl A boolean value indicating the state of the control key anAlt A boolean value indicating the state of the alt key aShift A boolean value indicating the state of the shift key aMeta A boolean value indicating the state of the meta key aButton A numeric value indicating which button is being emulated Argument list: aRelTarg A reference to an EventTarget object A new event object is manufactured by calling the DocumentEvent.createEvent() method. That event should have been defined with a type specified as “MouseEvent”. If it was, then it will support an initMouseEvent()method. This must be called before the event is dispatched otherwise the event object will not contain enough information for the event dispatcher/handler to make sense of it and route it to the correct target objects. Two boolean argument values define whether the event will be allowed to be cancelled and what type of propagation to use (bubbleor capture). The view argument refers to an AbstractView object which DOM level 2 describes and which may not yet be well supported by any browser. The detail value can be used to pass context information into the event handling chain. The screen and client coordinate values are measured in pixels and must be specified as numeric values. Five boolean values then define the state of keyboard keys when the event was assumed to be triggered. Finally a reference to a related target object is passed. See also: AbstractView object, EventTarget object, UIEvent.initUIEvent() 1461