标签:elf class eve log document 参考 ons normal ocs
亲测
IE浏览器仅 IE11 支持
document.getElementById("fullScreen").onclick = function() { if (document.documentElement.RequestFullScreen) { document.documentElement.RequestFullScreen(); } //兼容火狐 console.log(document.documentElement.msRequestFullscreen) if (document.documentElement.mozRequestFullScreen) { console.log(‘火狐‘) document.documentElement.mozRequestFullScreen(); } //兼容谷歌等可以webkitRequestFullScreen也可以webkitRequestFullscreen if (document.documentElement.webkitRequestFullScreen) { console.log(‘谷歌‘) document.documentElement.webkitRequestFullScreen(); } //兼容IE,只能写msRequestFullscreen if (document.documentElement.msRequestFullscreen) { console.log(‘ie‘) document.documentElement.msRequestFullscreen(); } } document.getElementById("fullScreenNormal").onclick = function() { if (document.exitFullScreen) { document.exitFullscreen() } //兼容火狐 console.log(document.mozExitFullScreen) if (document.mozCancelFullScreen) { document.mozCancelFullScreen() } //兼容谷歌等 if (document.webkitExitFullscreen) { document.webkitExitFullscreen() } //兼容IE if (document.msExitFullscreen) { document.msExitFullscreen() } }
标签:elf class eve log document 参考 ons normal ocs
原文地址:https://www.cnblogs.com/gongxiansheng/p/9646260.html