java 单机接口限流处理方案
393
2023-03-11
元素全屏的设置与监听实例
设置全屏和退出全屏
//全屏设置
$('#fullScreen').on('click', function () {
fullScreen();
});
//退出全屏
$('#exitFullScreen')yjaaPlygk.on('click', function () {
exitFullScreen();
});
//进入全屏
function fullScreen() {
var obj = document.getElementById('editMark');
if (obj.requestFullScreen) {
obj.requestFullScreen();
} else if (obj.webkitRequestFullScreen) {
obj.webkitRequestFullScreen();
} else if (obj.msRequestFullScreen) {
obj.msRequestFullScreen();
} else if (obj.mozRequestFullScreen) {
obj.mozRequestFullScreen();
}
}
function exitFullScreen() {
var obj = document.getElementById('editMark');
if (document.exitFullscree) {
document.exitFullscree();
} else if (document.webkitExitFullscreen) {
document.webkitExitFullscreen();
} else if (document.msExitFullscreen) {
document.msExitFullscreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
}
}
监听全屏事件
//监听全屏
document.addEventListener('fullscreenchange', function () {
if (documenyjaaPlygkt.fullscreenElement) {
alert(1);
} else {
alert(2);
}
}, false);
document.addEventListener('msfullscreenchange', function () {
if (document.msFullscreenElement) {
alert(1);
} else {
alert(2);
}
}, false);
document.addEventListener('mozfullscreenchange', function () {
if (document.mozFullScreen) {
alert(1);
} else {
alert(2);
}
}, false);
yjaaPlygkdocument.addEventListener('webkitfullscreenchange', function () {
if (document.webkitIsFullScreen) {
alert(1);
} else {
alert(2);
}
}, false);
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~