gpt4 book ai didi

javascript - iFrame 的 webkit fullscreenchange 事件

转载 作者:行者123 更新时间:2023-11-28 10:06:08 24 4
gpt4 key购买 nike

/* works on all elements except iframes */
document.addEventListener("webkitfullscreenchange", function() {
alert("hello world");
}, false);

/* never triggers even when iFrame enters full screen */
myIframe.addEventListener("webkitfullscreenchange", function() {
alert("hello iframe");
}, false);

我无法获取事件监听器 webkitfullscreenchange 事件来触发 iframe。 iFrame 是同源的。有谁知道如何获得这项工作?谢谢。

最佳答案

如果有人问同样的问题,则必须在 iframe 上设置allowfullscreen=true

( https://wiki.mozilla.org/Gecko:FullScreenAPI#fullscreenchange_event )

关于javascript - iFrame 的 webkit fullscreenchange 事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8351776/

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