w3pop.com :: ÍøÂçѧԺ :: HTML DOM :: DOM ʼþ
The event object gives you information about an event that has occurred.
ʼþ¶ÔÏóÌṩ¹ØÓÚʼþ·¢ÉúµÄÐÅÏ¢
Which mouse button was clicked?
Äĸö°´Å¥±»µãÁË£¿
What are the coordinates of the cursor?
ÓαêµÄ×ø±ê£¿
What is the unicode of the key pressed?
°´¼üµÄunicdeΪ£¿
What are the coordinates of the cursor, relative to the screen?
ÓαêÏà¶ÔÓÚÆÁÄ»µÄ×ø±ê£¿
What are the coordinates of the cursor?
ÓαêµÄ×ø±ê
Was the shift key pressed?
shift°´¼üÊÇ·ñ°´ÏÂ
Which element was clicked?
ÄĸöÔªËØ±»µã»÷ÁË£¿
Which eventype occured?
·¢ÉúÁËÄÄÖÖÀàÐ͵Äʼþ£¿
The Event object represents the state of an event, such as the element in which the event occurred, the state of the keyboard keys, the location of the mouse, and the state of the mouse buttons.
ʼþ¶ÔÏó´ú±í×ÅÒ»¸öʼþµÄ״̬£¬Æ©Èç·¢ÉúʼþµÄÔªËØ£¬¼üÅ̰´¼üµÄ״̬£¬Êó±ê°´Å¥µÄ״̬¡£
The event object is available only during an event - that is, you can use it in event handlers but not in other code.
ʼþ¶ÔÏóÖ»ÓÐÔÚ¿ÉÒÔʹÓÃʼþ´¦Àí¶ø²»ÊÇÆäËû´úÂë´¦Àíʱ²Å»áÓÐЧ¡£
In VBScript, you must access the event object through the window object.
ÔÚVBSÀÄã±ØÐëͨ¹ýwindow¶ÔÏóÀ´·ÃÎÊʼþ¶ÔÏó
The Event object's collections, properties and events are described below:
ÏÂÃæÊÇÓйØÊ¼þ¶ÔÏóµÄ¼¯ºÏ£¬ÊôÐÔÒÔ¼°Ê¼þµÄÃèÊö£º
IE: Internet Explorer, F: Firefox, N: Netscape, W3C: World Wide Web Consortium (Internet Standard).
| Collection ¼¯ºÏ |
Description ÃèÊö |
IE | F | N | W3C |
|---|---|---|---|---|---|
| bookmarks[] | Returns a collection of bookmarks connected to the rows affected by the events ·µ»ØÀ¦°óµ½µ±Ç°Ê¼þËùÓ°ÏìµÄÐÐÉϵÄÊéÇ©µÄ¼¯ºÏ¡£ |
||||
| boundElements[] | Returns a collection of all elements on a page which are bound to a data test ·µ»ØÒ³ÃæÉÏËùÓа󶨵½¸ø¶¨Êý¾Ý¼¯µÄËùÓÐÔªËØµÄ¼¯ºÏ¡£ |
| Property ÊôÐÔ |
Description ÃèÊö |
IE | F | N | W3C |
|---|---|---|---|---|---|
| Abstract | Returns the Abstract content in an Advanced Stream Redirector (ASX) file Óà event ¶ÔÏó»ñÈ¡¸ß¼¶Á÷ÖØ¶¨ÏòÆ÷(ASX)ÎļþÖÐÏîÄ¿ºá·ùµÄ Abstract ÄÚÈÝ¡£ |
6 | |||
| altKey | Sets or returns a Boolean value that indicates the state of the ALT key ÉèÖûò»ñÈ¡ Alt ¼üµÄ״̬¡£ |
4 | |||
| altLeft | Returns a Boolean value that indicates the state of the left ALT key ÉèÖûò»ñÈ¡×ó Alt ¼üµÄ״̬¡£ |
5 | |||
| banner | Returns the Banner content in an ASX file ʹÓà event ¶ÔÏó»ñÈ¡¸ß¼¶Á÷ÖØ¶¨ÏòÆ÷(ASX)ÎļþÖÐÏîÄ¿µÄ Banner ÄÚÈÝ¡£ |
6 | |||
| button | Sets or returns the mouse button pressed by the user ÉèÖûò»ñÈ¡Óû§Ëù°´µÄÊó±ê°´Å¥¡£
|
4 | |||
| cancelBubble | Sets or returns a Boolean value that indicates whether or not the current event should bubble up the hierarchy of event handlers ÉèÖûò»ñÈ¡µ±Ç°Ê¼þÊÇ·ñÒªÔÚʼþ¾ä±úÖÐÏòÉÏðÅÝ¡£ |
4 | |||
| clientX | Sets or returns the x-coordinate of the mouse pointer - relative to the screen, excluding decorations and scroll bars ÉèÖûò»ñÈ¡Êó±êÖ¸ÕëλÖÃÏà¶ÔÓÚ´°¿Ú¿Í»§ÇøÓòµÄ x ×ø±ê£¬ÆäÖпͻ§ÇøÓò²»°üÀ¨´°¿Ú×ÔÉíµÄ¿Ø¼þºÍ¹ö¶¯Ìõ¡£ |
4 | |||
| clientY | Sets or returns the y-coordinate of the mouse pointer - relative to the screen, excluding decorations and scroll bars ÉèÖûò»ñÈ¡Êó±êÖ¸ÕëλÖÃÏà¶ÔÓÚ´°¿Ú¿Í»§ÇøÓòµÄ y ×ø±ê£¬ÆäÖпͻ§ÇøÓò²»°üÀ¨´°¿Ú×ÔÉíµÄ¿Ø¼þºÍ¹ö¶¯Ìõ¡£ |
4 | |||
| contentOverflow | »ñÈ¡±íÃ÷Îĵµ´¦Àíµ±Ç° LayoutRect ¶ÔÏóºóÊÇ·ñ°üº¬¸½¼ÓµÄÄÚÈÝ¡£ | 5 | |||
| ctrlKey | Sets or returns a Boolean value that indicates the state of the CTRL key ÉèÖûò»ñÈ¡ Ctrl ¼üµÄ״̬¡£ |
4 | |||
| ctrlLeft | Sets or returns a Boolean value that indicates the state of the left CTRL key ÉèÖûò»ñÈ¡×ó Ctrl ¼üµÄ״̬¡£ |
5 | |||
| dataFld | Sets or returns the data column affected by the oncellchange event ÉèÖûò»ñÈ¡ oncellchange ʼþÓ°ÏìµÄÊý¾ÝÁС£ |
5 | |||
| fromElement | Sets or returns the object from which activation or the mouse pointer is exiting during the event ÉèÖûò»ñȡʼþ·¢Éúʱ¼¤»î»òÊó±ê½«ÒªÀ뿪µÄ¶ÔÏó¡£ |
4 | |||
| keyCode | Sets or returns the UNICODE of the key pressed ÉèÖûò»ñÈ¡Óëµ¼ÖÂʼþµÄ°´¼ü¹ØÁªµÄ Unicode °´¼ü´úÂë¡£ |
4 | |||
| MoreInfo | Returns the MoreInfo content in an ASX file ͨ¹ý event ¶ÔÏó»ñÈ¡¸ß¼¶Á÷ÖØ¶¨ÏòÆ÷(ASX)ÎļþÖÐÏîÄ¿ºá·ùµÄ MoreInfo ÄÚÈÝ¡£ |
6 | |||
| nextPage | Returns the position of the next page within a print template »ñÈ¡´òÓ¡Ä£°åÖÐÏÂÒ³µÄλÖᣠ|
5 | |||
| offsetX | Sets or returns the x-coordinate of the mouse pointer relative to the object firing the event ÉèÖûò»ñÈ¡Êó±êÖ¸ÕëλÖÃÏà¶ÔÓÚ´¥·¢Ê¼þµÄ¶ÔÏóµÄ x ×ø±ê¡£ |
4 | |||
| offsetY | Sets or returns the y-coordinate of the mouse pointer relative to the object firing the event ÉèÖûò»ñÈ¡Êó±êÖ¸ÕëλÖÃÏà¶ÔÓÚ´¥·¢Ê¼þµÄ¶ÔÏóµÄ y ×ø±ê¡£ |
4 | |||
| propertyName | Sets or returns the name of the property that has changed on the object ÉèÖûò»ñÈ¡¶ÔÏóÉÏ·¢Éú¸ü¸ÄµÄÊôÐÔÃû³Æ¡£ |
5 | |||
| qualifier | ÉèÖûò»ñÈ¡ÓÉÊý¾ÝÔ´¶ÔÏóÌṩµÄÊý¾Ý³ÉÔ±µÄÃû³Æ¡£ | 5 | |||
| reason | Sets or returns the result of a data transfer for a data source ÉèÖûò»ñÈ¡Êý¾ÝÔ´¶ÔÏóµÄÊý¾Ý´«Êä½á¹û¡£
|
4 | |||
| recordset | Sets or returns a reference to the default record set in a data source ´ÓÊý¾ÝÔ´¶ÔÏóÉèÖûò»ñÈ¡¶ÔĬÈÏÊý¾Ý¼¯µÄÒýÓᣠ|
4 | |||
| repeat | Returns a Boolean value that indicates whether the ONKEYDOWN event is being repeated »ñÈ¡ onkeydown ʼþÊÇ·ñÕýÔÚÖØ¸´¡£ |
5 | |||
| returnValue | Sets or returns the return value from an event ÉèÖûò»ñȡʼþµÄ·µ»ØÖµ¡£ |
4 | |||
| saveType | Returns the clipboard type when ONCONTENTSAVE fires µ± oncontentsave ´¥·¢Ê±»ñÈ¡¼ôÌù°åÀàÐÍ¡£ |
5 | |||
| screenX | Sets or returns the x-coordinate of the mouse pointer - relative to the screen ÉèÖûò»ñÈ¡»ñÈ¡Êó±êÖ¸ÕëλÖÃÏà¶ÔÓÚÓû§ÆÁÄ»µÄ x ×ø±ê¡£ |
4 | |||
| screenY | Sets or returns the y-coordinate of the mouse pointer - relative to the screen ÉèÖûò»ñÈ¡Êó±êÖ¸ÕëλÖÃÏà¶ÔÓÚÓû§ÆÁÄ»µÄ y ×ø±ê¡£ |
4 | |||
| shiftKey | Returns a Boolean value that indicates the state of the SHIFT key ÉèÖûò»ñÈ¡ Shift ¼üµÄ״̬¡£ |
4 | |||
| shiftLeft | Returns a Boolean value that indicates the state of the left SHIFT key ÉèÖûò»ñÈ¡×ó Shift ¼üµÄ״̬¡£ |
5 | |||
| srcElement | Sets or returns the object that fired the event ÉèÖûò»ñÈ¡´¥·¢Ê¼þµÄ¶ÔÏó¡£ |
4 | |||
| srcFilter | Sets or returns the filter object that fired the ONFILTERCHANGE event ÉèÖûò»ñÈ¡´¥·¢ onfilterchange ʼþµÄÂ˾µ¶ÔÏó¡£ |
4 | |||
| srcUrn | Sets or returns the Universal Resource Name (URN) of the behavior that fired the event »ñÈ¡´¥·¢Ê¼þµÄÐÐΪµÄͳһ×ÊÔ´Ãû³Æ(URN)¡£ |
5 | |||
| toElement | Sets or returns a reference to the object toward which the user is moving the mouse pointer ÉèÖûò»ñÈ¡Óû§Òª½«Êó±êÖ¸ÕëÒÆ¶¯Ö¸ÏòµÄ¶ÔÏóµÄÒýÓᣠ|
4 | |||
| type | Sets or returns the event name ´Ó event ¶ÔÏóÖлñȡʼþÃû³Æ¡£ |
4 | |||
| userName | 5 | ||||
| wheelDelta | Returns the distance and the direction the wheel button has rolled ÉèÖûò»ñÈ¡¹öÂÖ°´Å¥¹ö¶¯µÄ¾àÀëºÍ·½Ïò¡£ |
5 | |||
| x | Sets or returns the x-coordinate (in px) of the mouse pointer - relative to a relatively positioned parent element ÉèÖûò»ñÈ¡Êó±êÖ¸ÕëλÖÃÏà¶ÔÓÚ¸¸ÎĵµµÄ x ÏñËØ×ø±ê¡£ |
4 | |||
| y | Sets or returns the y-coordinate (in px) of the mouse pointer - relative to a relatively positioned parent element ÉèÖûò»ñÈ¡Êó±êÖ¸ÕëλÖÃÏà¶ÔÓÚ¸¸ÎĵµµÄ y ÏñËØ×ø±ê¡£ |
4 |