gpt4 book ai didi

google-chrome - 在 Chrome 中使用 animate.css 时出现全屏视频问题

转载 作者:行者123 更新时间:2023-11-28 21:41:03 26 4
gpt4 key购买 nike

我有一个页面包含使用视频标签的视频。此外,我的页面使用 animate.css 向我的元素添加一些动画。问题是当我在 animate.css 中使用样式时,我的视频无法正确全屏显示。这是我的页面示例:

<div id="wrapper">
<div id="page-wrapper" class="gray-bg dashbard-1">
<h2 id="sv_title">Here is some text for illustration</h2>

<div class="animated fadeInRight">
<video src="http://www.w3schools.com/html/mov_bbb.mp4" controls=""></video>
</div>
</div>
</div>

https://jsfiddle.net/p4nmt637/

此外,这个问题似乎只发生在 chrome 中,我在 FireFox 和 Safari 中测试过,我没有遇到这个问题。

最佳答案

这似乎是一个 Chrome 错误。问题是由 animation-fill-mode 设置为 both 引起的。这会使动画在视频父容器上保持事件状态,这似乎会干扰全屏视频。

解决方法

通过将其改回默认值 none,我们解决了全屏问题。在此示例中,动画填充模式通过 .custom 类更改。

例子

this jsfiddle 中有一个工作示例.

/*Uncomment the class to fix*/  

/*
.custom {
animation-fill-mode: none;
}
*/
<link href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.4.0/animate.css" rel="stylesheet" />
<h2 id="sv_title">This is the problem, the bottom video is being layered over the top when this is made fullscreen. Uncomment the custom class to see it fix itself.</h2>
<div class="animated fadeInRight custom">
<video src="http://www.w3schools.com/html/mov_bbb.mp4" controls></video>
</div>

<div class="animated fadeInRight">
<video src="http://www.w3schools.com/html/mov_bbb.mp4" autoplay muted></video>
</div>

关于google-chrome - 在 Chrome 中使用 animate.css 时出现全屏视频问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32323499/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com