浏览器全屏
var dE = document.documentElement;
//W3C
if(dE.requestFullscreen){
dE.requestFullscreen();
}
//FireFox
else if (dE.mozRequestFullScreen) {
dE.mozRequestFullScreen();
}
//Chrome等
else if (dE.webkitRequestFullScreen) {
dE.webkitRequestFullScreen();
}
//IE11
else if (elem.msRequestFullscreen) {
elem.msRequestFullscreen();
}
退出全屏
if (document.exitFullscreen) {
document.exitFullscreen();
}
else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
}
else if (document.webkitCancelFullScreen) {
document.webkitCancelFullScreen();
}
else if (document.msExitFullscreen) {
document.msExitFullscreen();
}
video全屏
//oV为获取video的id命名的元素名
if (oV.requestFullscreen) {
oV.requestFullscreen();
} else if (oV.mozRequestFullScreen) {
oV.mozRequestFullScreen();
} else if (oV.webkitRequestFullScreen) {
oV.webkitRequestFullScreen();
}