const toggleFullScreen = () => {
if (!document.fullscreen && !document.fullscreenElement) {
document.documentElement.requestFullscreen();
// false, null
} else {
document.exitFullscreen();
// true, html dom
}
}
document.addEventListener("keydown", (e) => {
// Enter
if (e.keyCode === 13) {
toggleFullScreen();
}
}, false);
第6天 用js实现最大化和最小化窗口
最新推荐文章于 2024-07-16 14:13:45 发布
关键词由CSDN通过智能技术生成