function FullScreen(){ var el = $('html')[0]; // The element to be full screen, if you want the full page full screen, it is recommended to use the html node instead of the body node var isFullscreen=document.fullScreen||document.mozFullScreen || document.webkitIsFullScreen; if (!isFullscreen){ // Enter full screen, multiple short-circuit expressions (el.requestFullscreen&&el.requestFullscreen())|| (el.mozRequestFullScreen &&el.mozRequestFullScreen())|| (el.webkitRequestFullscreen &&el. webkitRequestFullscreen())||(el.msRequestFullscreen&& el.msRequestFullscreen()); } else { // Exit full screen, ternary operator document.exitFullscreen? document.exitFullscreen(): document.mozCancelFullScreen?document.mozCancelFullScreen(): document.webkitExitFullscreen?document.webkitExitFullscreen():''; } }
Just call this method directly.
Use the esc key to exit full screen.
There is still a difference between the full screen of this method and the full screen of F11.