gpt4 book ai didi

javascript - FullScreenChange 事件不起作用

转载 作者:搜寻专家 更新时间:2023-10-31 21:59:30 24 4
gpt4 key购买 nike

我尝试绑定(bind) FullScreenChange 事件,但它不起作用。也许我做错了什么?

$(document).bind('webkitfullscreenchange mozfullscreenchange fullscreenchange',function(){
if(document.fullScreen){
console.log('Go to Full Screen mode');
}else{
console.log('Exit Full Screen mode');
}
});

最佳答案

您可能需要为 document.fullScreen 属性使用特定于 vendor 的前缀

var isFullScreen = document.fullScreen || 
document.mozFullScreen ||
document.webkitIsFullScreen;

此处提供更多信息:

https://developer.mozilla.org/en-US/docs/DOM/Using_fullscreen_mode

关于javascript - FullScreenChange 事件不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14549547/

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