当前位置:网站首页>js实现看板全屏功能
js实现看板全屏功能
2022-08-09 08:45:00 【鱼是一只鱼啊】
界面示意图
界面关键部分
<img class="fullImg" src="/Images/full.png" onclick="fullScreen()" />
js关键部分
function fullScreen() {
var dd = document.documentElement
var isFull = isFullScreen();
if (!isFull) {
if (dd.requestFullscreen) {
dd.requestFullscreen();
} else if (dd.mozRequestFullScreen) {
dd.mozRequestFullScreen();
} else if (dd.webkitRequestFullScreen) {
dd.webkitRequestFullScreen();
}
} else {
var de = document;
if (de.exitFullscreen) {
de.exitFullscreen();
} else if (de.mozCancelFullScreen) {
de.mozCancelFullScreen();
} else if (de.webkitCancelFullScreen) {
de.webkitCancelFullScreen();
}
}
}
function isFullScreen() {
return !!(
document.fullscreen ||
document.mozFullScreen ||
document.webkitIsFullScreen ||
document.webkitFullScreen ||
document.msFullScreen
);
}
边栏推荐
- Three handshakes, four waves
- scp upload file to remote server
- get一个小技巧,教你如何在typora写文章上传图片到博客上
- Conversion between number systems
- leetcode 36. 有效的数独(模拟题)
- Venture DAO 行业研报:宏观和经典案例分析、模式总结、未来建议
- MySQL数据库
- nyoj306 走迷宫(搜索+二分)
- Boot process and service control
- XCTF College War "Epidemic" Network Security Sharing Competition Misc wp
猜你喜欢
随机推荐
Tencent cloud server is modified to root login to install pagoda panel
How does STM32 know the usage of FLASH
Some of the topics in VNCTF2021 are reproduced
sizeof 结构体问题
嵌入式之串口中断只能收到一个字节
网络层协议介绍
Routing configuration forwarding and experiment
eTS UI development learning
Where does detection go forward?
GBJ610-ASEMI超薄整流扁桥GBJ610
OpenHarmony Light Smart Product Development Live Notes
Programming a washing machine: garbled characters after string output
pip3 source change to improve speed
VMware virtual machine cannot be connected to the Internet after forced shutdown
【CNN】2022 ECCV Oral 自反馈学习的mixup训练框架AutoMix
Matlab, and nonlinear equations solving linear equations
[Vulnerability reproduction] CVE-2018-12613 (remote file inclusion)
Max Flow P
继承中的运算符重载:输入输出的传奇
The principle and configuration of VLAN