在 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.