日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 前端技术 > javascript >内容正文

javascript

javascript事件与event对象的属性

發布時間:2023/12/1 javascript 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 javascript事件与event对象的属性 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
javascript事件列表解說
事件瀏覽器支持解說
一般事件onclickIE3、N2鼠標點擊時觸發此事件
ondblclickIE4、N4鼠標雙擊時觸發此事件
onmousedownIE4、N4按下鼠標時觸發此事件
onmouseupIE4、N4鼠標按下后松開鼠標時觸發此事件
onmouseoverIE3、N2當鼠標移動到某對象范圍的上方時觸發此事件
onmousemoveIE4、N4鼠標移動時觸發此事件
onmouseoutIE4、N3當鼠標離開某對象范圍時觸發此事件
onkeypressIE4、N4當鍵盤上的某個鍵被按下并且釋放時觸發此事件.
onkeydownIE4、N4當鍵盤上某個按鍵被按下時觸發此事件
onkeyupIE4、N4當鍵盤上某個按鍵被按放開時觸發此事件
頁面相關事件onabortIE4、N3圖片在下載時被用戶中斷
onbeforeunloadIE4、N當前頁面的內容將要被改變時觸發此事件
onerrorIE4、N3出現錯誤時觸發此事件
onloadIE3、N2頁面內容完成時觸發此事件
onmoveIE、N4瀏覽器的窗口被移動時觸發此事件
onresizeIE4、N4當瀏覽器的窗口大小被改變時觸發此事件
onscrollIE4、N瀏覽器的滾動條位置發生變化時觸發此事件
onstopIE5、N瀏覽器的停止按鈕被按下時觸發此事件或者正在下載的文件被中斷
onunloadIE3、N2當前頁面將被改變時觸發此事件
表單相關事件onblurIE3、N2當前元素失去焦點時觸發此事件
onchangeIE3、N2當前元素失去焦點并且元素的內容發生改變而觸發此事件
onfocusIE3 、N2當某個元素獲得焦點時觸發此事件
onresetIE4 、N3當表單中RESET的屬性被激發時觸發此事件
onsubmitIE3 、N2一個表單被遞交時觸發此事件
滾動字幕事件onbounceIE4、N在Marquee內的內容移動至Marquee顯示范圍之外時觸發此事件
onfinishIE4、N當Marquee元素完成需要顯示的內容后觸發此事件
onstartIE4、 N當Marquee元素開始顯示內容時觸發此事件
編輯事件onbeforecopyIE5、N當頁面當前的被選擇內容將要復制到瀏覽者系統的剪貼板前觸發此事件
onbeforecutIE5、 N當頁面中的一部分或者全部的內容將被移離當前頁面[剪貼]并移動到瀏覽者的系統剪貼板時觸發此事件
onbeforeeditfocusIE5、N當前元素將要進入編輯狀態
onbeforepasteIE5、 N內容將要從瀏覽者的系統剪貼板傳送[粘貼]到頁面中時觸發此事件
onbeforeupdateIE5、 N當瀏覽者粘貼系統剪貼板中的內容時通知目標對象
oncontextmenuIE5、N當瀏覽者按下鼠標右鍵出現菜單時或者通過鍵盤的按鍵觸發頁面菜單時觸發的事件
oncopyIE5、N當頁面當前的被選擇內容被復制后觸發此事件
oncutIE5、N當頁面當前的被選擇內容被剪切時觸發此事件
ondragIE5、N當某個對象被拖動時觸發此事件 [活動事件]
ondragdropIE、N4一個外部對象被鼠標拖進當前窗口或者幀
ondragendIE5、N當鼠標拖動結束時觸發此事件,即鼠標的按鈕被釋放了
ondragenterIE5、N當對象被鼠標拖動的對象進入其容器范圍內時觸發此事件
ondragleaveIE5、N當對象被鼠標拖動的對象離開其容器范圍內時觸發此事件
ondragoverIE5、N當某被拖動的對象在另一對象容器范圍內拖動時觸發此事件
ondragstartIE4、N當某對象將被拖動時觸發此事件
ondropIE5、N在一個拖動過程中,釋放鼠標鍵時觸發此事件
onlosecaptureIE5、N當元素失去鼠標移動所形成的選擇焦點時觸發此事件
onpasteIE5、N當內容被粘貼時觸發此事件
onselectIE4、N當文本內容被選擇時的事件
onselectstartIE4、N當文本內容選擇將開始發生時觸發的事件
數據綁定onafterupdateIE4、N當數據完成由數據源到對象的傳送時觸發此事件
oncellchangeIE5、N當數據來源發生變化時
ondataavailableIE4、N當數據接收完成時觸發事件
ondatasetchangedIE4、N數據在數據源發生變化時觸發的事件
ondatasetcompleteIE4、N當來子數據源的全部有效數據讀取完畢時觸發此事件
onerrorupdateIE4、N當使用onBeforeUpdate事件觸發取消了數據傳送時,代替onAfterUpdate事件
onrowenterIE5、N當前數據源的數據發生變化并且有新的有效數據時觸發的事件
onrowexitIE5、N當前數據源的數據將要發生變化時觸發的事件
onrowsdeleteIE5、N當前數據記錄將被刪除時觸發此事件
onrowsinsertedIE5、N當前數據源將要插入新數據記錄時觸發此事件
外部事件onafterprintIE5、N當文檔被打印后觸發此事件
onbeforeprintIE5、N當文檔即將打印時觸發此事件
onfilterchangeIE4、N當某個對象的濾鏡效果發生變化時觸發的事件
onhelpIE4、N當瀏覽者按下F1或者瀏覽器的幫助選擇時觸發此事件
onpropertychangeIE5、N當對象的屬性之一發生變化時觸發此事件
onreadystatechangeIE4、N當對象的初始化屬性值發生變化時觸發此事件

?

?

?

event對象的屬性

?

AbstractReturns the Abstract content in an Advanced Stream Redirector (ASX) file
用?event?對象獲取高級流重定向器(ASX)文件中項目橫幅的 Abstract 內容。
altKeySets or returns a Boolean value that indicates the state of the ALT key
設置或獲取 Alt 鍵的狀態。
altLeftReturns a Boolean value that indicates the state of the left ALT key
設置或獲取左 Alt 鍵的狀態。
bannerReturns the Banner content in an ASX file
使用?event?對象獲取高級流重定向器(ASX)文件中項目的 Banner 內容。
buttonSets or returns the mouse button pressed by the user
設置或獲取用戶所按的鼠標按鈕。
  • 0 - Default. No button pressed
    默認。沒有按鈕被按
  • 1 - Left button pressed
    左按鈕被按了
  • 2 - Right button pressed
    右按鈕被按了
  • 3 - Left and right buttons pressed
    左和右按鈕被同時按了
  • 4 - Middle button pressed
    中間的按鈕被按了
  • 5 - Left and middle buttons pressed
    左和中這倆按鈕被按了
  • 6 - Right and middle buttons pressed
    右和中這倆按鈕被按了
  • 7 - All three buttons are pressed
    所有三個按鈕同時被按

    firefox(版本2.0) 點擊鼠標左中右鍵, event.button的值分別為0,1,2
    IE(版本6) 點擊鼠標左中右鍵, event.button的值分別為 1,2,4

    參見:http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-MouseEvent
cancelBubbleSets or returns a Boolean value that indicates whether or not the current event should bubble up the hierarchy of event handlers
設置或獲取當前事件是否要在事件句柄中向上冒泡。
clientXSets or returns the x-coordinate of the mouse pointer - relative to the screen, excluding decorations and scroll bars
設置或獲取鼠標指針位置相對于窗口客戶區域的 x 坐標,其中客戶區域不包括窗口自身的控件和滾動條。
clientYSets or returns the y-coordinate of the mouse pointer - relative to the screen, excluding decorations and scroll bars
設置或獲取鼠標指針位置相對于窗口客戶區域的 y 坐標,其中客戶區域不包括窗口自身的控件和滾動條。
contentOverflow獲取表明文檔處理當前 LayoutRect 對象后是否包含附加的內容。
ctrlKeySets or returns a Boolean value that indicates the state of the CTRL key
設置或獲取 Ctrl 鍵的狀態。
ctrlLeftSets or returns a Boolean value that indicates the state of the left CTRL key
設置或獲取左 Ctrl 鍵的狀態。
dataFldSets or returns the data column affected by the oncellchange event
設置或獲取 oncellchange 事件影響的數據列。
fromElementSets or returns the object from which activation or the mouse pointer is exiting during the event
設置或獲取事件發生時激活或鼠標將要離開的對象。
keyCodeSets or returns the UNICODE of the key pressed
設置或獲取與導致事件的按鍵關聯的 Unicode 按鍵代碼。
MoreInfoReturns the MoreInfo content in an ASX file
通過?event?對象獲取高級流重定向器(ASX)文件中項目橫幅的 MoreInfo 內容。
nextPageReturns the position of the next page within a print template
獲取打印模板中下頁的位置。
offsetXSets or returns the x-coordinate of the mouse pointer relative to the object firing the event
設置或獲取鼠標指針位置相對于觸發事件的對象的 x 坐標。
offsetYSets or returns the y-coordinate of the mouse pointer relative to the object firing the event
設置或獲取鼠標指針位置相對于觸發事件的對象的 y 坐標。
propertyNameSets or returns the name of the property that has changed on the object
設置或獲取對象上發生更改的屬性名稱。
qualifier設置或獲取由數據源對象提供的數據成員的名稱。
reasonSets or returns the result of a data transfer for a data source
設置或獲取數據源對象的數據傳輸結果。
  • 0 - Successfully
    成功的
  • 1 - Aborted
    放棄的
  • 2 - Error
    錯誤的
recordsetSets or returns a reference to the default record set in a data source
從數據源對象設置或獲取對默認數據集的引用。
repeatReturns a Boolean value that indicates whether the ONKEYDOWN event is being repeated
獲取 onkeydown 事件是否正在重復。
returnValueSets or returns the return value from an event
設置或獲取事件的返回值。
saveTypeReturns the clipboard type when ONCONTENTSAVE fires
當 oncontentsave 觸發時獲取剪貼板類型。
screenXSets or returns the x-coordinate of the mouse pointer - relative to the screen
設置或獲取獲取鼠標指針位置相對于用戶屏幕的 x 坐標。
screenYSets or returns the y-coordinate of the mouse pointer - relative to the screen
設置或獲取鼠標指針位置相對于用戶屏幕的 y 坐標。
shiftKeyReturns a Boolean value that indicates the state of the SHIFT key
設置或獲取 Shift 鍵的狀態。
shiftLeftReturns a Boolean value that indicates the state of the left SHIFT key
設置或獲取左 Shift 鍵的狀態。
srcElementSets or returns the object that fired the event
設置或獲取觸發事件的對象。
srcFilterSets or returns the filter object that fired the ONFILTERCHANGE event
設置或獲取觸發 onfilterchange 事件的濾鏡對象。
srcUrnSets or returns the Universal Resource Name (URN) of the behavior that fired the event
獲取觸發事件的行為的統一資源名稱(URN)。
toElementSets or returns a reference to the object toward which the user is moving the mouse pointer
設置或獲取用戶要將鼠標指針移動指向的對象的引用。
typeSets or returns the event name
從 event 對象中獲取事件名稱。
wheelDeltaReturns the distance and the direction the wheel button has rolled
設置或獲取滾輪按鈕滾動的距離和方向。
xSets or returns the x-coordinate (in px) of the mouse pointer - relative to a relatively positioned parent element
設置或獲取鼠標指針位置相對于父文檔的 x 像素坐標。
ySets 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对象的属性的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。