/* 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/