1

我想写一个 html 页面让我的 psvita 浏览器全屏显示,并且 JavaScript API 像requestFullscreen(), mozRequestFullScreen(), msRequestFullscreen(),webkitRequestFullScreen()不起作用。

这是html: <button onclick="launchFullscreen(document.documentElement)">FullScreen</button>

这是 JavaScript:

function launchFullscreen(element) {
  if(element.requestFullscreen) {
    element.requestFullscreen();
  } else if(element.mozRequestFullScreen) {
    element.mozRequestFullScreen();
  } else if(element.msRequestFullscreen){
    element.msRequestFullscreen();
  } else if(element.webkitRequestFullscreen) {
    element.webkitRequestFullScreen();
  }
}
4

0 回答 0