當前位置:
首頁 >
前端技术
> javascript
>内容正文
javascript
javascript事件与event对象的属性
生活随笔
收集整理的這篇文章主要介紹了
javascript事件与event对象的属性
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
| javascript事件列表解說 | |||
| 事件 | 瀏覽器支持 | 解說 | |
| 一般事件 | onclick | IE3、N2 | 鼠標點擊時觸發此事件 |
| ondblclick | IE4、N4 | 鼠標雙擊時觸發此事件 | |
| onmousedown | IE4、N4 | 按下鼠標時觸發此事件 | |
| onmouseup | IE4、N4 | 鼠標按下后松開鼠標時觸發此事件 | |
| onmouseover | IE3、N2 | 當鼠標移動到某對象范圍的上方時觸發此事件 | |
| onmousemove | IE4、N4 | 鼠標移動時觸發此事件 | |
| onmouseout | IE4、N3 | 當鼠標離開某對象范圍時觸發此事件 | |
| onkeypress | IE4、N4 | 當鍵盤上的某個鍵被按下并且釋放時觸發此事件. | |
| onkeydown | IE4、N4 | 當鍵盤上某個按鍵被按下時觸發此事件 | |
| onkeyup | IE4、N4 | 當鍵盤上某個按鍵被按放開時觸發此事件 | |
| 頁面相關事件 | onabort | IE4、N3 | 圖片在下載時被用戶中斷 |
| onbeforeunload | IE4、N | 當前頁面的內容將要被改變時觸發此事件 | |
| onerror | IE4、N3 | 出現錯誤時觸發此事件 | |
| onload | IE3、N2 | 頁面內容完成時觸發此事件 | |
| onmove | IE、N4 | 瀏覽器的窗口被移動時觸發此事件 | |
| onresize | IE4、N4 | 當瀏覽器的窗口大小被改變時觸發此事件 | |
| onscroll | IE4、N | 瀏覽器的滾動條位置發生變化時觸發此事件 | |
| onstop | IE5、N | 瀏覽器的停止按鈕被按下時觸發此事件或者正在下載的文件被中斷 | |
| onunload | IE3、N2 | 當前頁面將被改變時觸發此事件 | |
| 表單相關事件 | onblur | IE3、N2 | 當前元素失去焦點時觸發此事件 |
| onchange | IE3、N2 | 當前元素失去焦點并且元素的內容發生改變而觸發此事件 | |
| onfocus | IE3 、N2 | 當某個元素獲得焦點時觸發此事件 | |
| onreset | IE4 、N3 | 當表單中RESET的屬性被激發時觸發此事件 | |
| onsubmit | IE3 、N2 | 一個表單被遞交時觸發此事件 | |
| 滾動字幕事件 | onbounce | IE4、N | 在Marquee內的內容移動至Marquee顯示范圍之外時觸發此事件 |
| onfinish | IE4、N | 當Marquee元素完成需要顯示的內容后觸發此事件 | |
| onstart | IE4、 N | 當Marquee元素開始顯示內容時觸發此事件 | |
| 編輯事件 | onbeforecopy | IE5、N | 當頁面當前的被選擇內容將要復制到瀏覽者系統的剪貼板前觸發此事件 |
| onbeforecut | IE5、 N | 當頁面中的一部分或者全部的內容將被移離當前頁面[剪貼]并移動到瀏覽者的系統剪貼板時觸發此事件 | |
| onbeforeeditfocus | IE5、N | 當前元素將要進入編輯狀態 | |
| onbeforepaste | IE5、 N | 內容將要從瀏覽者的系統剪貼板傳送[粘貼]到頁面中時觸發此事件 | |
| onbeforeupdate | IE5、 N | 當瀏覽者粘貼系統剪貼板中的內容時通知目標對象 | |
| oncontextmenu | IE5、N | 當瀏覽者按下鼠標右鍵出現菜單時或者通過鍵盤的按鍵觸發頁面菜單時觸發的事件 | |
| oncopy | IE5、N | 當頁面當前的被選擇內容被復制后觸發此事件 | |
| oncut | IE5、N | 當頁面當前的被選擇內容被剪切時觸發此事件 | |
| ondrag | IE5、N | 當某個對象被拖動時觸發此事件 [活動事件] | |
| ondragdrop | IE、N4 | 一個外部對象被鼠標拖進當前窗口或者幀 | |
| ondragend | IE5、N | 當鼠標拖動結束時觸發此事件,即鼠標的按鈕被釋放了 | |
| ondragenter | IE5、N | 當對象被鼠標拖動的對象進入其容器范圍內時觸發此事件 | |
| ondragleave | IE5、N | 當對象被鼠標拖動的對象離開其容器范圍內時觸發此事件 | |
| ondragover | IE5、N | 當某被拖動的對象在另一對象容器范圍內拖動時觸發此事件 | |
| ondragstart | IE4、N | 當某對象將被拖動時觸發此事件 | |
| ondrop | IE5、N | 在一個拖動過程中,釋放鼠標鍵時觸發此事件 | |
| onlosecapture | IE5、N | 當元素失去鼠標移動所形成的選擇焦點時觸發此事件 | |
| onpaste | IE5、N | 當內容被粘貼時觸發此事件 | |
| onselect | IE4、N | 當文本內容被選擇時的事件 | |
| onselectstart | IE4、N | 當文本內容選擇將開始發生時觸發的事件 | |
| 數據綁定 | onafterupdate | IE4、N | 當數據完成由數據源到對象的傳送時觸發此事件 |
| oncellchange | IE5、N | 當數據來源發生變化時 | |
| ondataavailable | IE4、N | 當數據接收完成時觸發事件 | |
| ondatasetchanged | IE4、N | 數據在數據源發生變化時觸發的事件 | |
| ondatasetcomplete | IE4、N | 當來子數據源的全部有效數據讀取完畢時觸發此事件 | |
| onerrorupdate | IE4、N | 當使用onBeforeUpdate事件觸發取消了數據傳送時,代替onAfterUpdate事件 | |
| onrowenter | IE5、N | 當前數據源的數據發生變化并且有新的有效數據時觸發的事件 | |
| onrowexit | IE5、N | 當前數據源的數據將要發生變化時觸發的事件 | |
| onrowsdelete | IE5、N | 當前數據記錄將被刪除時觸發此事件 | |
| onrowsinserted | IE5、N | 當前數據源將要插入新數據記錄時觸發此事件 | |
| 外部事件 | onafterprint | IE5、N | 當文檔被打印后觸發此事件 |
| onbeforeprint | IE5、N | 當文檔即將打印時觸發此事件 | |
| onfilterchange | IE4、N | 當某個對象的濾鏡效果發生變化時觸發的事件 | |
| onhelp | IE4、N | 當瀏覽者按下F1或者瀏覽器的幫助選擇時觸發此事件 | |
| onpropertychange | IE5、N | 當對象的屬性之一發生變化時觸發此事件 | |
| onreadystatechange | IE4、N | 當對象的初始化屬性值發生變化時觸發此事件 | |
?
?
?
event對象的屬性
?
| Abstract | Returns the Abstract content in an Advanced Stream Redirector (ASX) file 用?event?對象獲取高級流重定向器(ASX)文件中項目橫幅的 Abstract 內容。 |
| altKey | Sets or returns a Boolean value that indicates the state of the ALT key 設置或獲取 Alt 鍵的狀態。 |
| altLeft | Returns a Boolean value that indicates the state of the left ALT key 設置或獲取左 Alt 鍵的狀態。 |
| banner | Returns the Banner content in an ASX file 使用?event?對象獲取高級流重定向器(ASX)文件中項目的 Banner 內容。 |
| button | Sets or returns the mouse button pressed by the user 設置或獲取用戶所按的鼠標按鈕。
|
| cancelBubble | Sets or returns a Boolean value that indicates whether or not the current event should bubble up the hierarchy of event handlers 設置或獲取當前事件是否要在事件句柄中向上冒泡。 |
| clientX | Sets or returns the x-coordinate of the mouse pointer - relative to the screen, excluding decorations and scroll bars 設置或獲取鼠標指針位置相對于窗口客戶區域的 x 坐標,其中客戶區域不包括窗口自身的控件和滾動條。 |
| clientY | Sets or returns the y-coordinate of the mouse pointer - relative to the screen, excluding decorations and scroll bars 設置或獲取鼠標指針位置相對于窗口客戶區域的 y 坐標,其中客戶區域不包括窗口自身的控件和滾動條。 |
| contentOverflow | 獲取表明文檔處理當前 LayoutRect 對象后是否包含附加的內容。 |
| ctrlKey | Sets or returns a Boolean value that indicates the state of the CTRL key 設置或獲取 Ctrl 鍵的狀態。 |
| ctrlLeft | Sets or returns a Boolean value that indicates the state of the left CTRL key 設置或獲取左 Ctrl 鍵的狀態。 |
| dataFld | Sets or returns the data column affected by the oncellchange event 設置或獲取 oncellchange 事件影響的數據列。 |
| fromElement | Sets or returns the object from which activation or the mouse pointer is exiting during the event 設置或獲取事件發生時激活或鼠標將要離開的對象。 |
| keyCode | Sets or returns the UNICODE of the key pressed 設置或獲取與導致事件的按鍵關聯的 Unicode 按鍵代碼。 |
| MoreInfo | Returns the MoreInfo content in an ASX file 通過?event?對象獲取高級流重定向器(ASX)文件中項目橫幅的 MoreInfo 內容。 |
| nextPage | Returns the position of the next page within a print template 獲取打印模板中下頁的位置。 |
| offsetX | Sets or returns the x-coordinate of the mouse pointer relative to the object firing the event 設置或獲取鼠標指針位置相對于觸發事件的對象的 x 坐標。 |
| offsetY | Sets or returns the y-coordinate of the mouse pointer relative to the object firing the event 設置或獲取鼠標指針位置相對于觸發事件的對象的 y 坐標。 |
| propertyName | Sets or returns the name of the property that has changed on the object 設置或獲取對象上發生更改的屬性名稱。 |
| qualifier | 設置或獲取由數據源對象提供的數據成員的名稱。 |
| reason | Sets or returns the result of a data transfer for a data source 設置或獲取數據源對象的數據傳輸結果。
|
| recordset | Sets or returns a reference to the default record set in a data source 從數據源對象設置或獲取對默認數據集的引用。 |
| repeat | Returns a Boolean value that indicates whether the ONKEYDOWN event is being repeated 獲取 onkeydown 事件是否正在重復。 |
| returnValue | Sets or returns the return value from an event 設置或獲取事件的返回值。 |
| saveType | Returns the clipboard type when ONCONTENTSAVE fires 當 oncontentsave 觸發時獲取剪貼板類型。 |
| screenX | Sets or returns the x-coordinate of the mouse pointer - relative to the screen 設置或獲取獲取鼠標指針位置相對于用戶屏幕的 x 坐標。 |
| screenY | Sets or returns the y-coordinate of the mouse pointer - relative to the screen 設置或獲取鼠標指針位置相對于用戶屏幕的 y 坐標。 |
| shiftKey | Returns a Boolean value that indicates the state of the SHIFT key 設置或獲取 Shift 鍵的狀態。 |
| shiftLeft | Returns a Boolean value that indicates the state of the left SHIFT key 設置或獲取左 Shift 鍵的狀態。 |
| srcElement | Sets or returns the object that fired the event 設置或獲取觸發事件的對象。 |
| srcFilter | Sets or returns the filter object that fired the ONFILTERCHANGE event 設置或獲取觸發 onfilterchange 事件的濾鏡對象。 |
| srcUrn | Sets or returns the Universal Resource Name (URN) of the behavior that fired the event 獲取觸發事件的行為的統一資源名稱(URN)。 |
| toElement | Sets or returns a reference to the object toward which the user is moving the mouse pointer 設置或獲取用戶要將鼠標指針移動指向的對象的引用。 |
| type | Sets or returns the event name 從 event 對象中獲取事件名稱。 |
| wheelDelta | Returns the distance and the direction the wheel button has rolled 設置或獲取滾輪按鈕滾動的距離和方向。 |
| x | Sets or returns the x-coordinate (in px) of the mouse pointer - relative to a relatively positioned parent element 設置或獲取鼠標指針位置相對于父文檔的 x 像素坐標。 |
| y | Sets or returns the y-coordinate (in px) of the mouse pointer - relative to a relatively positioned parent element 設置或獲取鼠標指針位置相對于父文檔的 y 像素坐標。 |
轉載于:https://www.cnblogs.com/HCT118/p/5607387.html
總結
以上是生活随笔為你收集整理的javascript事件与event对象的属性的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: php无限分类
- 下一篇: javascript 高级特性探讨A4-