Upgrade to Pro — share decks privately, control downloads, hide ads and more …

JavaScript Practices

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.

JavaScript Practices

Avatar for Ryan Chung

Ryan Chung

May 22, 2020
Tweet

More Decks by Ryan Chung

Other Decks in Technology

Transcript

  1. 2 常見滑鼠/鍵盤事件 事件 描述 onclick 點擊 ondblclick 按兩下 onmousedown 在該元件上按下滑鼠鍵

    onmousemove 在該元件上移動滑鼠 onmouseover 滑鼠進入該元件範圍 onmouseout 滑鼠離開該元件範圍 onmouseup 在該元件上釋放滑鼠鍵 事件 描述 onkeydown 實體鍵盤被按下 onkeypress 有字元被輸入 onkeyup 實體鍵盤被放開
  2. 3 框架/物件事件 事件 描述 onload 檔、物件被載入 onscroll 文件捲動 onabort 取消載入

    onerror 載入錯誤 onresize 大小被改變 onunload 離開該頁面、進入新頁面、重新整理
  3. 9 計時器 • setTimeout( ):特定時間之後做什麼事情(一次) • clearTimeout( ):解除setTimeout • setInterval(

    ):每隔多少時間之後做什麼事情(反復) • clearInterval( ):解除setInterval