在 HTML 中,當 seeking 屬性設定為 true,表示正在進行搜尋時,執行一個指令碼?


在 HTML 中,使用 onseeking 屬性來表示影片中的搜尋功能處於啟用狀態。

示例

你可以嘗試執行以下程式碼,在 HTML 中當 seeking 屬性被設定為 true 以指示搜尋功能處於啟用狀態時執行一個指令碼 −

<!DOCTYPE html>
<html>
   <body>
      <video controls onseeking = "display()">
         <source src = "/html5/foo.ogg" type = "video/ogg" />
         <source src = "/html5/foo.mp4" type = "video/mp4" />
         Your browser does not support the video element.
      </video>
      <script>
         function display() {
            alert("Seeking starts!");
         }
      </script>
   </body>
</html>

更新於: 29-5 月-2020

93 次瀏覽

開啟你的 職業

透過完成課程獲得認證

開始
廣告
© . All rights reserved.