天天看點

讓頁面打開即全屏顯示方法!

function openFullScreen(OpenUrl)

{

 var Pop;

            if (self.screen) {

            sw = screen.width;

            sh = screen.height;

   w = sw-10; // to center: use desired width

   h = sh - 70; // to center: use desired height

   cx = 0;  // to center: (.5*sw) - (w*.5)

   cy = 0; // to center: (.5*sh) - (h*.5)

      var  dimentions_and_such = 'width='+w+','+'height='+h+',' + 'screenX=' +cx+','+'screenY='+cy+','+'left='+cx+','+'top='+cy+',toolbar=0,status=0,menubar=0,resizable=0';

      var  dimentions_and_such1 = 'scrollbars=0,width='+w+','+'height='+h+',' + 'screenX=' +cx+','+'screenY='+cy+','+'left='+cx+','+'top='+cy+',toolbar=0,status=0,fullscreen=1,menubar=0,resizable=0';

  if (screen.width < 900)

  {

   Pop=window.open(OpenUrl,"","toolbar=0,location=0,fullscreen=1,directories=0,status=0,menubar=0,scrollbars=0,resizable=0");

  }

  else if (screen.width > 1200)

  {

   Pop=window.open(OpenUrl,"",dimentions_and_such1);

  }

  else

  {

   Pop=window.open(OpenUrl,"",dimentions_and_such1);

  }

 }

}

//打開其他頁

openFullScreen(http://gavincome.cnblogs.com)

//打開本頁

openFullScreen(location.href)

轉載于:https://www.cnblogs.com/GavinCome/archive/2008/02/26/1082080.html