使用JavaScript在网站上结束视频后,如何显示联系表?
< script type ='text/javascript'> document.getElementsByClassName('hideVideo')。addeventListener('ended',myhandler,false);函数myhandler(e){var hidevideo = document.getElementsByClassName(“ hidevideo”)[0]; hidevideo.style.display =“ none”; }</script>
我正在创建一个网站,其中整个页面上仅显示1个视频。我想要的是在视频结束后,随着弹出式弹出,视频应该消失。如何使用JavaScript执行此操作?
<script type='text/javascript'> document.getElementsByClassName('hideVideo').addEventListener('ended',myHandler,false); function myHandler(e) { var hideVideo = document.getElementsByClassName("hideVideo")[0]; hideVideo.style.display = "none"; } </script>
I'm creating a website where only 1 video is shown on the entire page. What I want is after the video ends, contact form should come as a pop up and the video should disappear. How can I do this using javascript?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以在那里找到有关HTML视频元素事件的需求等。
html audio/video properties
You can find there what you need about html video element events and more.
HTML Audio/Video Properties
我认为这将与您要做的事情:
这是 source
I think this will with what you want to do:
This is the source
请致电行动
在审查下面的示例时,
&lt; video&gt;
以结束&lt; dialog&gt;
,并用&lt; form&gt; 将打开
&lt; dialog&gt;
将关闭&lt; iframe&gt;
✺ 将出现在&lt; video&gt;
下,并带有服务器响应✺不需要 - 仅添加例如
详细信息在示例中评论
Call to Action
When reviewing the example below:
<video>
to end<dialog>
with a<form>
will open<dialog>
will close<iframe>
✺ will appear under the<video>
with the server response✺Not required -- only added for example
Details are commented in example