久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

HTML5中事件屬性簡介

局事件屬性

HTML 4 增加了通過事件觸發(fā)瀏覽器中行為的能力,比如當(dāng)用戶點(diǎn)擊某個元素時啟動一段 JavaScript。

如果需要學(xué)習(xí)更多有關(guān)使用這些事件進(jìn)行編程的內(nèi)容,請學(xué)習(xí)我們的 JavaScript 教程 和 DHTML 教程。

下面的表格列出了可插入 HTML 5 元素中以定義事件行為的標(biāo)準(zhǔn)事件屬性。

  • Window 事件屬性 - Window Event Attributes
  • 表單事件 - Form Events
  • 鍵盤事件 - Keybord Events
  • 鼠標(biāo)事件 - Mouse Events
  • 媒介事件 - Media Events

new:HTML 5 中的新的事件屬性。

Window 事件屬性

window 對象觸發(fā)的事件。

適用于 <body> 標(biāo)簽:

屬性 描述
onafterprint script 在打印文檔之后運(yùn)行腳本
onbeforeprint script 在文檔打印之前運(yùn)行腳本
onbeforeonload script 在文檔加載之前運(yùn)行腳本
onblur script 當(dāng)窗口失去焦點(diǎn)時運(yùn)行腳本
onerror script 當(dāng)錯誤發(fā)生時運(yùn)行腳本
onfocus script 當(dāng)窗口獲得焦點(diǎn)時運(yùn)行腳本
onhaschange script 當(dāng)文檔改變時運(yùn)行腳本
onload script 當(dāng)文檔加載時運(yùn)行腳本
onmessage script 當(dāng)觸發(fā)消息時運(yùn)行腳本
onoffline script 當(dāng)文檔離線時運(yùn)行腳本
ononline script 當(dāng)文檔上線時運(yùn)行腳本
onpagehide script 當(dāng)窗口隱藏時運(yùn)行腳本
onpageshow script 當(dāng)窗口可見時運(yùn)行腳本
onpopstate script 當(dāng)窗口歷史記錄改變時運(yùn)行腳本
onredo script 當(dāng)文檔執(zhí)行再執(zhí)行操作(redo)時運(yùn)行腳本
onresize script 當(dāng)調(diào)整窗口大小時運(yùn)行腳本
onstorage script 當(dāng)文檔加載加載時運(yùn)行腳本
onundo script 當(dāng) Web Storage 區(qū)域更新時(存儲空間中的數(shù)據(jù)發(fā)生變化時)
onunload script 當(dāng)用戶離開文檔時運(yùn)行腳本

表單事件

由 HTML 表單內(nèi)部的動作觸發(fā)的事件。

適用于所有 HTML 5 元素,不過最常用于表單元素中:

屬性 描述
onblur script 當(dāng)元素失去焦點(diǎn)時運(yùn)行腳本
onchange script 當(dāng)元素改變時運(yùn)行腳本
oncontextmenu script 當(dāng)觸發(fā)上下文菜單時運(yùn)行腳本
onfocus script 當(dāng)元素獲得焦點(diǎn)時運(yùn)行腳本
onformchange script 當(dāng)表單改變時運(yùn)行腳本
onforminput script 當(dāng)表單獲得用戶輸入時運(yùn)行腳本
oninput script 當(dāng)元素獲得用戶輸入時運(yùn)行腳本
oninvalid script 當(dāng)元素?zé)o效時運(yùn)行腳本
onreset script 當(dāng)表單重置時運(yùn)行腳本。HTML 5 不支持。
onselect script 當(dāng)選取元素時運(yùn)行腳本
onsubmit script 當(dāng)提交表單時運(yùn)行腳本

鍵盤事件

由鍵盤觸發(fā)的事件。

適用于所有 HTML 5 元素:

屬性 描述
onkeydown script 當(dāng)按下按鍵時運(yùn)行腳本
onkeypress script 當(dāng)按下并松開按鍵時運(yùn)行腳本
onkeyup script 當(dāng)松開按鍵時運(yùn)行腳本

鼠標(biāo)事件

由鼠標(biāo)或相似的用戶動作觸發(fā)的事件。

適用于所有 HTML 5 元素:

屬性 描述
onclick script 當(dāng)單擊鼠標(biāo)時運(yùn)行腳本
ondblclick script 當(dāng)雙擊鼠標(biāo)時運(yùn)行腳本
ondrag script 當(dāng)拖動元素時運(yùn)行腳本
ondragend script 當(dāng)拖動操作結(jié)束時運(yùn)行腳本
ondragenter script 當(dāng)元素被拖動至有效的拖放目標(biāo)時運(yùn)行腳本
ondragleave script 當(dāng)元素離開有效拖放目標(biāo)時運(yùn)行腳本
ondragover script 當(dāng)元素被拖動至有效拖放目標(biāo)上方時運(yùn)行腳本
ondragstart script 當(dāng)拖動操作開始時運(yùn)行腳本
ondrop script 當(dāng)被拖動元素正在被拖放時運(yùn)行腳本
onmousedown script 當(dāng)按下鼠標(biāo)按鈕時運(yùn)行腳本
onmousemove script 當(dāng)鼠標(biāo)指針移動時運(yùn)行腳本
onmouseout script 當(dāng)鼠標(biāo)指針移出元素時運(yùn)行腳本
onmouseover script 當(dāng)鼠標(biāo)指針移至元素之上時運(yùn)行腳本
onmouseup script 當(dāng)松開鼠標(biāo)按鈕時運(yùn)行腳本
onmousewheel script 當(dāng)轉(zhuǎn)動鼠標(biāo)滾輪時運(yùn)行腳本
onscroll script 當(dāng)滾動元素滾動元素的滾動條時運(yùn)行腳本

媒介事件

由視頻、圖像以及音頻等媒介觸發(fā)的事件。

適用于所有 HTML 5 元素,不過在媒介元素(諸如 audio、embed、img、object 以及 video)中最常用:

屬性 描述
onabort script 當(dāng)發(fā)生中止事件時運(yùn)行腳本
oncanplay script 當(dāng)媒介能夠開始播放但可能因緩沖而需要停止時運(yùn)行腳本
oncanplaythrough script 當(dāng)媒介能夠無需因緩沖而停止即可播放至結(jié)尾時運(yùn)行腳本
ondurationchange script 當(dāng)媒介長度改變時運(yùn)行腳本
onemptied script 當(dāng)媒介資源元素突然為空時(網(wǎng)絡(luò)錯誤、加載錯誤等)運(yùn)行腳本
onended script 當(dāng)媒介已抵達(dá)結(jié)尾時運(yùn)行腳本
onerror script 當(dāng)在元素加載期間發(fā)生錯誤時運(yùn)行腳本
onloadeddata script 當(dāng)加載媒介數(shù)據(jù)時運(yùn)行腳本
onloadedmetadata script 當(dāng)媒介元素的持續(xù)時間以及其他媒介數(shù)據(jù)已加載時運(yùn)行腳本
onloadstart script 當(dāng)瀏覽器開始加載媒介數(shù)據(jù)時運(yùn)行腳本
onpause script 當(dāng)媒介數(shù)據(jù)暫停時運(yùn)行腳本
onplay script 當(dāng)媒介數(shù)據(jù)將要開始播放時運(yùn)行腳本
onplaying script 當(dāng)媒介數(shù)據(jù)已開始播放時運(yùn)行腳本
onprogress script 當(dāng)瀏覽器正在取媒介數(shù)據(jù)時運(yùn)行腳本
onratechange script 當(dāng)媒介數(shù)據(jù)的播放速率改變時運(yùn)行腳本
onreadystatechange script 當(dāng)就緒狀態(tài)(ready-state)改變時運(yùn)行腳本
onseeked script 當(dāng)媒介元素的定位屬性 [1] 不再為真且定位已結(jié)束時運(yùn)行腳本
onseeking script 當(dāng)媒介元素的定位屬性為真且定位已開始時運(yùn)行腳本
onstalled script 當(dāng)取回媒介數(shù)據(jù)過程中(延遲)存在錯誤時運(yùn)行腳本
onsuspend script 當(dāng)瀏覽器已在取媒介數(shù)據(jù)但在取回整個媒介文件之前停止時運(yùn)行腳本
ontimeupdate script 當(dāng)媒介改變其播放位置時運(yùn)行腳本
onvolumechange script 當(dāng)媒介改變音量亦或當(dāng)音量被設(shè)置為靜音時運(yùn)行腳本
onwaiting script 當(dāng)媒介已停止播放但打算繼續(xù)播放時運(yùn)行腳本

[1]:定位屬性的英文譯文是:seeking attribute。

【網(wǎng)站聲明】本站除付費(fèi)源碼經(jīng)過測試外,其他素材未做測試,不保證完整性,網(wǎng)站上部分源碼僅限學(xué)習(xí)交流,請勿用于商業(yè)用途。如損害你的權(quán)益請聯(lián)系客服QQ:2655101040 給予處理,謝謝支持。

相關(guān)文檔推薦

這篇文章主要介紹了有關(guān)HTML5頁面在iPhoneX適配問題,需要的朋友可以參考下
本篇文章主要介紹了html5中canvas圖表實(shí)現(xiàn)柱狀圖的示例,本文使用canvas來實(shí)現(xiàn)一個圖表,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
Adobe公司出品的多媒體處理軟件產(chǎn)品線較多,涵蓋了音視頻編輯、圖像處理、平面設(shè)計(jì)、影視后期等領(lǐng)域。這篇文章主要介紹了Adobe Html5 Extension開發(fā)初體驗(yàn)圖文教程,非常不錯,需要的朋
這篇文章主要介紹了基于HTML5的WebGL經(jīng)典3D虛擬機(jī)房漫游動畫,需要的朋友可以參考下
這篇文章主要介紹了手機(jī)端用rem+scss做適配的詳解,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
本篇文章主要介紹了canvas 實(shí)現(xiàn) github404動態(tài)效果的示例代碼,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
主站蜘蛛池模板: 午夜视频一区二区 | 超碰在线亚洲 | 国产精品久久久久久久久久 | 成人午夜免费在线视频 | 国产成人精品视频在线观看 | 99久久视频 | 亚洲一区不卡 | 国产成人麻豆免费观看 | 7777久久| 久久精彩 | 在线视频成人 | 懂色av一区二区三区在线播放 | 亚洲女人天堂成人av在线 | 国产精品日韩欧美一区二区三区 | 久久高清| 亚洲国产精品99久久久久久久久 | 日本一区二区高清视频 | 美女天天干天天操 | 欧美在线成人影院 | 久久国产婷婷国产香蕉 | 91精品国产乱码久久久久久久 | 无码国模国产在线观看 | 国产乱码精品一区二三赶尸艳谈 | 日日干天天操 | 一级黄色片在线免费观看 | 国产免费让你躁在线视频 | 久久机热 | 中文字幕不卡视频在线观看 | 可以免费观看的av片 | 成人欧美一区二区三区黑人孕妇 | 视频精品一区二区三区 | 欧美日韩专区 | 久草青青草 | 99资源站 | 美女一级a毛片免费观看97 | 国产美女精品视频 | www国产成人免费观看视频,深夜成人网 | 国产精品毛片无码 | 男女网站视频 | 91免费在线视频 | 免费视频久久久久 |