让页面打开即全屏显示方法!

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)

posted @ 2008-02-26 13:21  赖文华.NET  阅读(4342)  评论(1)    收藏  举报