/*全屏展示*/
showFull () {
var isSupport = true;
var el = document.documentElement
var rfs = el.requestFullScreen || el.webkitRequestFullScreen
if (typeof rfs != 'undefined' && rfs) {
rfs.call(el)
} else if (typeof window.ActiveXObject != 'undefined') {
var wscript = new ActiveXObject('WScript.Shell')
if (wscript != null) {
wscript.SendKeys('{F11}')
}
} else if (el.msRequestFullscreen) {
el.msRequestFullscreen()
} else if (el.oRequestFullscreen) {
el.oRequestFullscreen()
} else if (el.webkitRequestFullscreen) {
el.webkitRequestFullscreen()
} else if (el.mozRequestFullScreen) {
el.mozRequestFullScreen()
} else {
isSupport = false;
this.$message.error('该浏览器不支持全屏操作,请更换或升级浏览器!')
}
// if (isSupport) {
// this.setFullPdf(true);
// } else {
// this.setFullPdf(false);
// }
},
exitFull() {
// $('#XMLContent').css('font-size','18px')
// 判断各种浏览器,找到正确的方法
var el = document;
var exitMethod = el.exitFullscreen || //W3C
el.mozCancelFullScreen || //Chrome等
el.webkitExitFullscreen || //FireFox
el.msExitFullscreen; //IE11
if (exitMethod) {
exitMethod.call(el);
}
else if (typeof window.ActiveXObject !== "undefined") {//for Internet Explorer
var wscript = new ActiveXObject("WScript.Shell");
if (wscript !== null) {
wscript.SendKeys("{F11}");
}
}
},
注意 ie10以下不支持全屏报错问题解决,将方法写在全屏方法的上面,.pdfFullBox代表需要全屏的部分
this.showArtTopFlip(false);
showArtTopFlip(state, res) {
//全屏隐藏导航
state.headerShow = res;
if (res === false) {
$(".pdfFullBox").addClass("pdfFull_active");
} else {
$(".pdfFullBox").removeClass("pdfFull_active");
}
},
.pdfFull_active {
position: fixed;
top: 0;
bottom: 0;
right: 0;
left: 0;
z-index: 10;
}