【问题标题】:How to change the div when the video is completed如何在视频完成时更改div
【发布时间】:2023-01-09 20:38:22
【问题描述】:

视频完成后,它应该会自动转到下一个 div,但我不知道该怎么做

我正在尝试这样的事情website

【问题讨论】:

    标签: javascript html css


    【解决方案1】:

    你甚至可以在视频中使用ended

    https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/ended_event

    
    <video src="<put source>" id="videoId">
      fallback
    </video>
    
    <script>
        document.getElementById('videoId').addEventListener('ended',() => {
         // your logic to show the div goes here
    });
    </script>
    
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-08-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多